[Haskell-cafe] The simple programming language,

2006-03-26 Thread pinturicchio
if somebody can help me wid this i wil b realy thankful Finally, we come to the program. The simple programming language, which includes loops, conditionals and sequential composition will be expressed a datatype in Haskell. data Prg = Skip | PrintS String | PrintE Exp | Declare Variable |

[Haskell-cafe] pls fast help me with this simple question

2006-03-26 Thread iliali16
type Data = Integer type Variable = String type Store = [(Variable, Data)] Store = [(,0)] emptystore :: Store emptystore = [(,0)] getVal :: Store - Variable - Data thats my code i just have to continue and get the value of a variable from the store but i don't know how the task is : Define a

[Haskell-cafe] Equirecursive types?

2006-03-26 Thread Jim Apple
According to Pierce's book, O'Caml has an optional equirecursive type extension that turns off the occurs check. Is there any particular reason Haskell doesn't have that available? Here's what got me thinking about it: http://lambda-the-ultimate.org/node/1360#comment-15656 Jim

Re: [Haskell-cafe] pls fast help me with this simple question

2006-03-26 Thread Sebastian Sylvan
On 3/26/06, iliali16 [EMAIL PROTECTED] wrote: type Data = Integer type Variable = String type Store = [(Variable, Data)] Store = [(,0)] emptystore :: Store emptystore = [(,0)] getVal :: Store - Variable - Data thats my code i just have to continue and get the value of a variable from

[Haskell-cafe] A Haskell Tutorial

2006-03-26 Thread Jonathan Tang
Hi all, I've written a Haskell tutorial that walks the reader through the implementation of a Scheme interpreter: http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/overview.html Instead of focusing on small examples at the Haskell REPL, it tries to show the reader how to construct a

Re: [Haskell-cafe] The simple programming language,

2006-03-26 Thread Cale Gibbard
Well, I'm sure that lots of people here would be willing to help if you'd be more specific about what you're having trouble with. Just posting an assignment problem tends not to generate much discussion until after the assignment deadline. What have you already tried? What part are you stuck on?

Re: [Haskell-cafe] Re: Positive integers

2006-03-26 Thread Daniel McAllansmith
On Friday 24 March 2006 14:37, you wrote: An additive torsor is? Surprisingly, there is a page on MathWorld about Torsors but it is empty. Google turned up the following page with a good explanation. http://math.ucr.edu/home/baez/torsors.html Nice clear explanation that. Thanks for the

Re: [Haskell-cafe] Re: Positive integers

2006-03-26 Thread Daniel McAllansmith
On Friday 24 March 2006 16:16, Ben Rudiak-Gould wrote: Daniel McAllansmith wrote: I can see the domain bounds check would be a problem in theory, but in practice doesn't the type enforce that? Keeping Word positive costs nothing because it just overflows. Wouldn't it be much the same?

Re: [Haskell-cafe] Positive integers

2006-03-26 Thread Daniel McAllansmith
On Friday 24 March 2006 23:29, Malcolm Wallace wrote: Daniel McAllansmith [EMAIL PROTECTED] wrote: Unless I've missed it, there is no typeclass for positive integers in GHC. Is there any particular reason it doesn't exist? Also, it seems Word would be a far better type in the likes of

Re: [Haskell-cafe] Re: Positive integers

2006-03-26 Thread ajb
G'day all. Quoting Jared Updike [EMAIL PROTECTED]: Surprisingly, there is a page on MathWorld about Torsors but it is empty. Google turned up the following page with a good explanation. http://math.ucr.edu/home/baez/torsors.html Ah, right. So torsor is just a short name for regular group

Re: [Haskell-cafe] Building Monads from Monads

2006-03-26 Thread Daniel McAllansmith
On Friday 24 March 2006 16:42, Cale Gibbard wrote: Excellent help thanks, Cale. A lot of my misunderstandings stemmed from not finding any 'instance MonadState ReaderT' when reading the code in Reader.hs, not realising that there was an instance defined in State.hs, and yet being able to use

Re: [Haskell-cafe] Equirecursive types?

2006-03-26 Thread Ross Paterson
On Sun, Mar 26, 2006 at 01:22:17PM -0500, Jim Apple wrote: According to Pierce's book, O'Caml has an optional equirecursive type extension that turns off the occurs check. Is there any particular reason Haskell doesn't have that available? It's certainly feasible, though turning off the occurs

[Haskell-cafe] error vs. MonadError vs. fail

2006-03-26 Thread Daniel McAllansmith
Is there a consensus on how anticipatable failure situations should be handled? There was a thread, haskell programming guidelines, from 2006-02-25 where John Meacham and Cale Gibbard had a bit of back-and-forth about using Monad.fail or a purpose specific MonadFail class. I believe a

[Haskell-cafe] Re: Positive integers

2006-03-26 Thread Aaron Denney
On 2006-03-26, Daniel McAllansmith [EMAIL PROTECTED] wrote: I was thinking about several things in this thread, torsors, overflow semantics, bounds checking... I wonder if there would be any merit in being able to define constrained subsets of integers and the semantics when/if they

[Haskell-cafe] Re: (!!) operator usage

2006-03-26 Thread Tom Davies
Tom Davies tomdavies at exemail.com.au writes: [snip] Apologies for the complete misinformation! I don't know what I was thinking! Tom ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe