Lennart Augustsson:
Shae Matijs Erisson wrote:
Gregory Woodhouse <[EMAIL PROTECTED]> writes:
My knowledge of functional programming is pretty much limited to
Haskell,
Scheme, and a smattering of Common Lisp. Are there languages other than
Haskell that explicitly use monads? How about "not so
Shae Matijs Erisson wrote:
Please respond with any language implementations I've missed.
C++ http://www.cc.gatech.edu/~yannis/fc++/New1.5/lambda.html#monad
Jim
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/lis
Shae Matijs Erisson wrote:
Gregory Woodhouse <[EMAIL PROTECTED]> writes:
My knowledge of functional programming is pretty much limited to Haskell,
Scheme, and a smattering of Common Lisp. Are there languages other than
Haskell that explicitly use monads? How about "not so explicitly"?
Java ht
> Yes, but this StateT type application cannot be equal to the outer StateT type
> application because this would result in an infinite type which Haskell
> doesn't support. Example:
>
> StateT Int (StateT Int (StateT Int ...))
I see. I was trying to justify the lazy pattern in this mplus,
Gregory Woodhouse <[EMAIL PROTECTED]> writes:
> My knowledge of functional programming is pretty much limited to Haskell,
> Scheme, and a smattering of Common Lisp. Are there languages other than
> Haskell that explicitly use monads? How about "not so explicitly"?
Java http://www.ccs.neu.edu/home
Am Donnerstag, 24. November 2005 21:52 schrieb Fan Wu:
> > They cannot belong to the same monad. If s is the state type and m1' and
> > m2' belong to the monad m then m1 and m2 belong to the monad StateT s m.
>
> I know it looks insane, I'm just trying to make a recursive case of
> it: technically
Am Donnerstag, 24. November 2005 21:37 schrieb Fan Wu:
> [...]
> This is a good example! But now I got the impression that pattern
> match failure could happen in many places, so unless you want it to
> fail loudly, you shall always use lazy pattern?
Often you need pattern matching for distinguis
> They cannot belong to the same monad. If s is the state type and m1' and m2'
> belong to the monad m then m1 and m2 belong to the monad StateT s m.
I know it looks insane, I'm just trying to make a recursive case of
it: technically it's still possible to have a StateT monad as the m in
"StateT
tor 2005-11-24 klockan 12:36 -0800 skrev Gregory Woodhouse:
> My knowledge of functional programming is pretty much limited to
> Haskell, Scheme, and a smattering of Common Lisp. Are there languages
> other than Haskell that explicitly use monads? How about "not so
> explicitly"?
>
> ===
> G
> They are useful not only in conjunction with infinite data structures. Take
> my example state transformer "everything" and modify it so that it calls next
> exactly two times, not infinitely many times, and outputs a pair of the
> outputs of the two next invocations.
>
> Now let's assume you us
My knowledge of functional programming is pretty much limited to
Haskell, Scheme, and a smattering of Common Lisp. Are there languages
other than Haskell that explicitly use monads? How about "not so
explicitly"?
===
Gregory Woodhouse
[EMAIL PROTECTED]
"The universe is not required to be i
Am Donnerstag, 24. November 2005 21:19 schrieben Sie:
> [...]
> Here I want to correct a statement I made previously about:
>
> mplus m1 m2 = do ...
> ~(a,s') <- lift (mplus m1' m2')
>
> In one of my emails to the thread I mentioned m1/m2 and m1'/m2' could
> be dif
> But I think the reasons behind lazy pattern usage in the mplus
> implementation are similar to those behind lazy pattern usage in the (>>=)
> implementation.
I find the explanation of "Lazy patterns are useful in contexts where
infinite data structures are being defined recursively" is easier to
Am Donnerstag, 24. November 2005 02:08 schrieb David Menendez:
> Wolfgang Jeltsch writes:
> > If we use an implementation of State *without lazy patterns*, it
> > becomes something like this:
> >
> > \s -> case next s of
> > (x,s') -> case everyting s' of
> > (xs,s'')
Am Donnerstag, 24. November 2005 01:49 schrieb Fan Wu:
> Hi Wolfgang,
>
> Thanks for your response and examples! It helps a lot.
>
> From your example I can see "Lazy patterns are useful in contexts
> where infinite data structures are being defined recursively" (quote
> section 4.4 of Gentle Intro
Hi Wolfgang,
I think you have a very good point. I'll buy it:-)
> [There is a "do" missing before the lazy pattern, isn't it?]
That's right!
Thanks!
Fan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/has
Am Donnerstag, 24. November 2005 19:24 schrieb Fan Wu:
> Hi Wolfgang,
>
> I don't know the history so maybe this is a new implementation of
> State transformer. The Peek and poke functions are defined below
> (copied from StateT.hs):
>
> instance Monad m => StateM (StateT s m) s where
> peek
First of all, read this :)
http://haskell.org/hawiki/HomeworkHelp
There doesn't appear to be a list for Haskell homework help in the
list of mailing lists on haskell.org. If Jerzy knows more about one,
he might be able to provide some information there.
We'll be happy to help, but what have you a
Hi Wolfgang,
I don't know the history so maybe this is a new implementation of
State transformer. The Peek and poke functions are defined below
(copied from StateT.hs):
instance Monad m => StateM (StateT s m) s where
peek = S (\s -> return (s,s))
poke s= S (\s1 -> ret
whoals (sent by Nabble.com):
Define a function parts which returns the list of distinct partitions of an
integer n.
Send this query perhaps to haskell-homeworks list?
JK
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskel
A partition of a positive integer n is a representation of n as the sum of any number of positive integral parts. For example, there are 7 partitions of the number 5: 1+1+1+1+1, 1+1+1+2, 1+1+3, 1+2+2, 1+4, 2+3 and 5. Define a function parts which returns the list of distinct partitions of an integ
On 22 November 2005 10:07, Dusan Kolar wrote:
> My question is rather strange, maybe, even if simple:
> Does ghci always translates with "-O" option set on?
I didn't see anyone answer this specific question: the answer is "no",
GHCi does not optimise. Optimisation cannot be used when interpret
On 24 November 2005 01:35, Shae Matijs Erisson wrote:
> Bulat Ziganshin <[EMAIL PROTECTED]> writes:
>
They work, even in a context switching regime, but I can't
exploit all the CPU's on my computer. Always is "active"
just one thread
>> this will not help. multi-processing support
David Menendez wrote:
Keean Schupke writes:
HList can do O(log n) by the way, if the labels have order, you can
implement a binary search tree of labels (Of course all the accessor
functions would need to be rewritten).
The idea of writing a type-level balanced binary search tree fil
Am Mittwoch, 23. November 2005 20:42 schrieb Wolfgang Jeltsch:
> Am Mittwoch, 23. November 2005 19:02 schrieb Fan Wu:
> [...]
> > But it is still not clear to me why lazy pattern is used here. Any ideas?
>
> Let's discuss this for State instead of StateT because this makes the
> discussion easier.
Am Mittwoch, 23. November 2005 10:03 schrieb Fan Wu:
> Hi Haskell gurus,
>
> I'm very puzzled on some code I saw in GHC Monad.StateT (which is
> about state monad transformers) source and hope you can kindly give me
> some insight into this.
>
> newtype StateT s m a = S (s -> m (a,s))
>
> instance
On 11/23/05, Bulat Ziganshin <[EMAIL PROTECTED]> wrote:
> Hello Sebastian,
>
> Wednesday, November 23, 2005, 6:46:54 PM, you wrote:
>
> >> They work, even in a context switching regime, but I can't
> >> exploit all the CPU's on my computer. Always is "active"
> >> just one thread
>
> SS> Did you co
27 matches
Mail list logo