Hi Casey,
Do you have these snippets already? If so, I can't wait to see them :)
On Tue, Jun 22, 2010 at 4:42 AM, Twan van Laarhoven twa...@gmail.comwrote:
Casey Hawthorne wrote:
Is there good place to post Haskell alorithms/data structures that
follow Steven Skiena's book on algorithm
Hi again,
El mar, 22-06-2010 a las 13:36 +1200, Hamish Mackenzie escribió:
On 22 Jun 2010, at 08:01, Giuseppe Luigi Punzi Ruiz wrote:
uhmm..
Now, with all gtk2 rebuilded with +no_x11 and +quartz I get
Linking dist/build/leksah/leksah ...
ld: library not found for -lgtk-x11-2.0
Hello
Maybe permutation trees are a viable starting point?
See the paper Parsing Permutation Phrases which appears to be on CiteSeer.
Some slides are also here - the data type definitions and Functor
instance for permutation trees are on page 18 (pdf index page 19):
On Jun 19, 2010, at 1:48 PM, Heinrich Apfelmus wrote:
In my code, mzero is indeed an identity for orElse [...]
The observation is any action can be brought into one of the forms
mzero
return a `mplus` return b `mplus` ...
which corresponds to the list type [a] .
Ok that makes sense
malcolm.wallace malcolm.wallace at me.com writes:
I haven't been following closely, but how did you install haddock? From a
binary dist? Is it possible that
one of the Windows binary dists has a baked-in location for something on
the E: drive, which existed on
the packager's machine but
Paul Johnson wrote:
Yves Parès wrote:
It helps me understand better, but would you have some simple code
that would do that ?
http://www.cs.chalmers.se/~koen/pubs/jfp99-monad.ps
You can also understand coroutines and continuations in terms of
operational semantics. Here is a
Sebastian Fischer wrote:
Heinrich Apfelmus wrote:
[...] you can implement your type as
newtype CMaybe a = CMaybe { forall b . (a - [b]) - [b] }
Yes. For me it was interesting to see how far we get by wrapping `Maybe`
in `Codensity`: we get more than `Maybe` but not as much as `[]`.
Hello.
I have been teaching an introductory course on compiler construction to
our undergraduates students using Appel's Modern Compiler
Implementation in Java. There are also versions of the book in ML and
C. The books explain how to write a compiler for the Tiger programming
language.
Now I
2010/6/22 José Romildo Malaquias j.romi...@gmail.com:
Hello.
I have been teaching an introductory course on compiler construction to
our undergraduates students using Appel's Modern Compiler
Implementation in Java. There are also versions of the book in ML and
C. The books explain how to
On Tue, Jun 22, 2010 at 09:33:22AM -0300, José Romildo Malaquias wrote:
In the variable escaping analysis phase of the compiler, a function
findEscape looks for escaping variables and record this information in
the escape fields of the abstract syntax. To do this the entire abstract
syntax
Hello
Doaitse Swierstra has a Tiger compiler written in Haskell + UUAG as a
demonstration for UUAG attribute grammar system.
The package on Hackage only contains the derived source - i.e not the
original attribute grammar code, but the generated Haskell source
after running UUAG on the *.ag
On Tue, Jun 22, 2010 at 02:30:04PM +0100, Stephen Tetley wrote:
Hello
Doaitse Swierstra has a Tiger compiler written in Haskell + UUAG as a
demonstration for UUAG attribute grammar system.
The package on Hackage only contains the derived source - i.e not the
original attribute grammar
On Tue, Jun 22, 2010 at 02:54:08PM +0200, Vo Minh Thu wrote:
2010/6/22 José Romildo Malaquias j.romi...@gmail.com:
Hello.
I have been teaching an introductory course on compiler construction to
our undergraduates students using Appel's Modern Compiler
Implementation in Java. There are
2010/6/22 José Romildo Malaquias j.romi...@gmail.com:
On Tue, Jun 22, 2010 at 02:54:08PM +0200, Vo Minh Thu wrote:
2010/6/22 José Romildo Malaquias j.romi...@gmail.com:
Hello.
I have been teaching an introductory course on compiler construction to
our undergraduates students using
On Tue, Jun 22, 2010 at 10:01:37AM -0300, Felipe Lessa wrote:
On Tue, Jun 22, 2010 at 09:33:22AM -0300, José Romildo Malaquias wrote:
In the variable escaping analysis phase of the compiler, a function
findEscape looks for escaping variables and record this information in
the escape fields
Esteemed fellow haskellers,
I recently ran into a very simple real life case where Haskell's rules for
inferring the types for mutually recursive definitions resulted in a type
that was less general than it could be. It took me a while to realize that
the type error I was getting wasn't actually
Hi all,
I have below duplicate code, but i don't know how to use TH instance code.
-- duplicate code start
--
instance Variable PageType where
toVariant = toVariant . show
fromVariant x = fmap (\v - read v :: PageType) $
What you're looking for is something like:
deriveVariable _t = [d|
instance Variable $t where
toVariant = toVariant . show
fromVariant x = fmap (\v - read v :: $t) $ fromVariant x|]
deriveVariable (conT ''PageType)
deriveVariable (conT ''Int)
deriveVariable (conT ''Maybe
v-- I had accidentally elided the _'s before the t's in the quasiquotation
before.
What you're looking for is something like:
deriveVariable _t = [d|
instance Variable $_t where
toVariant = toVariant . show
fromVariant x = fmap (\v - read v :: $_t) $ fromVariant x|]
On Tue, Jun 22, 2010 at 6:24 PM, Andy Stewart lazycat.mana...@gmail.comwrote:
Hi all,
I have below duplicate code, but i don't know how to use TH instance code.
-- duplicate code start
--
instance Variable PageType where
toVariant
I have below duplicate code, but i don't know how to use TH instance code.
-- duplicate code start
--
instance Variable PageType where
toVariant = toVariant . show
fromVariant x = fmap (\v - read v :: PageType) $ fromVariant x
If
John Meacham wrote:
In particular, a Huffman coding:
http://en.wikipedia.org/wiki/Huffman_coding
is ideal for this (assuming you just are taking advantage of frequency
analysis). A dynamic Huffman Tree will even adapt as it is being used to
whatever the current language is. Huffman Trees are
A little library for reading s-record files:
http://hackage.haskell.org/package/srec
-Tom
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
L.S.,
I just read about Minix and found a discussion [1] about Andrew Tanenbaum
(the creator of Minix) wanting to try drivers written in Haskell on Minix.
It has been four years since, is there currently a way to (cross)compile
Haskell programs for Minix?
Haskell well suited to write
On Mon, 21 Jun 2010, Maurício CA wrote:
bitspeak is a small proof of concept application that allows
writing text using only two commands (yes/no, 1/2, top/down etc.).
There is a parallel between data compression algorithms and this sort of
task, expressing a sentence in the minimal
On Tue, Jun 22, 2010 at 06:24:22PM +0100, Andrew Coppin wrote:
John Meacham wrote:
In particular, a Huffman coding:
http://en.wikipedia.org/wiki/Huffman_coding
is ideal for this (assuming you just are taking advantage of frequency
analysis). A dynamic Huffman Tree will even adapt as it is
john:
On Tue, Jun 22, 2010 at 06:24:22PM +0100, Andrew Coppin wrote:
John Meacham wrote:
In particular, a Huffman coding:
http://en.wikipedia.org/wiki/Huffman_coding
is ideal for this (assuming you just are taking advantage of frequency
analysis). A dynamic Huffman Tree will even adapt
On Tue, Jun 08, 2010 at 11:21:54AM -0700, Gregory Crosswhite wrote:
Or you just put an upper bound on the versions of the fgl library that
your program will build against, as you should be doing anyway, and
then nothing breaks.
Until some package you rely on decides to upgrade and start using
Don Stewart wrote:
http://hackage.haskell.org/package/huffman
A simple and pure Haskell implementation of the Huffman encoding algorithm.
What the...?
Oh, I see. It uses another package to handle the tricky sorting and
searching stuff. Well, yeah, that would make the code a bit
The problem is that nothing breaks immediately.
Then someone else comes along and transitively depends on your package and
on another package, which depends on the newer version.
Your users wind up with strange conflicts like that if they are using Parsec
3 they can't use HTTP.
Or if they use
On Tue, Jun 22, 2010 at 08:54:26PM +0200, Henk-Jan van Tuyl wrote:
I just read about Minix and found a discussion [1] about Andrew
Tanenbaum (the creator of Minix) wanting to try drivers written in
Haskell on Minix. It has been four years since, is there currently a
way to (cross)compile
There is no reason that your program couldn't link to multiple versions
of the same package so that each library can access the version that it
needs. In fact, GHC already does this, doesn't it? For example, I use
a mixture of libraries in my programs that link to QuickCheck 1 and
QuickCheck
Hi Edward,
Thank you very much, your code works perfect!
-- Andy
Edward Kmett ekm...@gmail.com writes:
v-- I had accidentally elided the _'s before the t's in the quasiquotation
before.
What you're looking for is something like:
deriveVariable _t = [d|
instance Variable $_t where
On Tue, Jun 22, 2010 at 4:18 PM, Andrew Coppin
andrewcop...@btinternet.comwrote:
What the...?
Oh, I see. It uses another package to handle the tricky sorting and
searching stuff. Well, yeah, that would make the code a bit shorter... ;-)
Even so, it's not nearly as elegant to behold as,
On Tue, Jun 22, 2010 at 10:18 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
Don Stewart wrote:
http://hackage.haskell.org/package/huffman
A simple and pure Haskell implementation of the Huffman encoding
algorithm.
What the...?
Oh, I see. It uses another package to handle
I uninstalled all ports and macports, to try with gtk-osx
Once I did all of this, leksah builds, but leksah-server don't, with
problems with version of libgthread2.
I'm at jhbuild build meta-gtk-osx-bootstrap step of GTK-OSX.
Once the next step (jhbuild build meta-gtk-osx-core) is finished,
When I tried to do something like:
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
class Test a where
type TestMonad a :: * - *
from :: a b - TestMonad a b
to :: TestMonad a b - a b
data Testable a b = Testable (a b)
instance (Test a, Functor
On Jun 22, 2010, at 21:41 , Maciej Piechotka wrote:
test.hs:11:0:
Constraint is no smaller than the instance head
in the constraint: Functor (TestMonad a)
(Use -XUndecidableInstances to permit this)
In the instance declaration for `Functor (Testable a)'
What is undecidable? a
On Tue, 2010-06-22 at 21:51 -0400, Brandon S. Allbery KF8NH wrote:
On Jun 22, 2010, at 21:41 , Maciej Piechotka wrote:
test.hs:11:0:
Constraint is no smaller than the instance head
in the constraint: Functor (TestMonad a)
(Use -XUndecidableInstances to permit this)
In the
For those others like me who have no idea what s-record files are:
http://en.wikipedia.org/wiki/S-record
On 23 June 2010 03:36, Tom Hawkins tomahawk...@gmail.com wrote:
A little library for reading s-record files:
http://hackage.haskell.org/package/srec
-Tom
On Wednesday 23 June 2010 03:41:47, Maciej Piechotka wrote:
When I tried to do something like:
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
class Test a where
type TestMonad a :: * - *
from :: a b - TestMonad a b
to :: TestMonad a b - a b
data
G'day all.
Quoting Andrew Coppin andrewcop...@btinternet.com:
What the...?
Oh, I see. It uses another package to handle the tricky sorting and
searching stuff. Well, yeah, that would make the code a bit shorter...
;-)
Even so, it's not nearly as elegant to behold as, say, the quicksort
On Tue, Jun 22, 2010 at 9:08 PM, Ivan Miljenovic
ivan.miljeno...@gmail.com wrote:
For those others like me who have no idea what s-record files are:
http://en.wikipedia.org/wiki/S-record
Sorry, I should have been more clear. In embedded systems
development, s-records are typically used to hold
Hey everyone,
Could someone explain to me (or point me to a reference explaining) the
purpose of the some and many methods of the Alternative class?
Also, there is a link posted in the documentation for
Control.Applicative to a paper which describes the motivation behind the
Applicative
Hi,
Can anyone tell me a way to identify the generated assembly (as found in the
intermediate files produced by GHC) corresponding to a particular fragment of
Core code.
Thanks,
Rami
The information in this e-mail may be confidential and subject to legal
Rami.Mukhtar:
Hi,
Can anyone tell me a way to identify the generated assembly (as found in the
intermediate files produced by GHC) corresponding to a particular fragment of
Core code.
Hey Rami,
I use the ghc-core tool:
http://hackage.haskell.org/package/ghc-core
Which displays both
I have a parameterized data type:
data Val result = VNum Double | VThunk (SomeMonad result)
type Environ result = Map Symbol (Val result)
I have a class to make it easier to typecheck Vals:
class Typecheck a where
from_val :: Val result - Maybe a
instance Typecheck Double where
On 23 June 2010 13:46, Evan Laforge qdun...@gmail.com wrote:
I have a parameterized data type:
data Val result = VNum Double | VThunk (SomeMonad result)
type Environ result = Map Symbol (Val result)
I have a class to make it easier to typecheck Vals:
class Typecheck a where
from_val ::
On Wednesday 23 June 2010 05:46:46, Evan Laforge wrote:
I have a parameterized data type:
data Val result = VNum Double | VThunk (SomeMonad result)
type Environ result = Map Symbol (Val result)
I have a class to make it easier to typecheck Vals:
class Typecheck a where
from_val :: Val
On Wed, 23 Jun 2010, Maciej Piechotka wrote:
When I tried to do something like:
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
class Test a where
type TestMonad a :: * - *
from :: a b - TestMonad a b
to :: TestMonad a b - a b
data Testable a b =
G'day all.
But honestly, it's just not that hard to do in linear time, assuming
the symbols are sorted by frequency:
Or maybe not so easy.
Andrew Bromage
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
I'm not sure how Alternative differs from MonadPlus, other than being
defined for Applicative rather than Monad. They have the same laws
(identity and associativity).
Some and many are probably motivated by their usefulness in
parsers. Hence optional, etc. I'm sure there are plenty of other
52 matches
Mail list logo