#haskell - Wed 4 Apr 2007 between 00:00 and 00:14

should =~ Just Work?
Caleboowax: the second function is also using the list monad -- what are you expecting the type of tmp to be?
sorear@index ByteArray
sorear@index BA
Caleboowax: also, you've given in the type signature, the return value as being ThrowsError Type
but makeTypeList is going to give a list, not a ThrowsError a
boowaxCale: It should be a list of Type values that I want to use within the dummyFunction but not necessarily return
Caleokay, so you probably want let, and not <-
let tmp = makeTypeList t tenv
throwError $ EICE (show tmp)
return TyBrokenRecord
also, might be a good idea to avoid putting tabs in your source files.
(get your editor to convert them to spaces)
syntaxfreesignificant whitespace is such a mixed blessing.
my first attempts at haskell barfed not because of types, but of indenting.
of course, it was the horrible, contrived example of recursive IO in YAHT.
The "age-guesser" program.
boowaxCale: I appreciate your help. I hope you can bear with my ignorance. Do I still need the do {} with the let statement? If you don't mind, I don't really understand what let give me?
CaleOkay. That was intended as a let statement in the do-block.
I'm assuming that ThrowsError is a monad.
In fact, based on the error you're getting from the compiler, ThrowsError seems like a type synonym for Either ErrorTy
actionsyntaxfree has become obsessed with spotting Arial and Helvetica, speaking of type.
syntaxfreehas become obsessed with spotting Arial and Helvetica, speaking of type.
CaleThere are two forms for let in Haskell
syntaxfreenow I stare at signs from way too close.
CaleAs an expression, you can write: let <decls> in <expr>
syntaxfreeI got myself a headache trying to tell Arial from Helvetica on this stupid college zine while on a moving bus that was shaking.
CaleIn a do-block, you're allowed to leave off the 'in' part, and the declarations will scope over the remainder of the 'do'
That is...
boowaxCale: ThrowsError is basically what you said it was...to allow errors to go up the chain or normal returns to happen
Caledo { <stmts1>; let <decls>; <stmts2> } = do { <stmts1>; let <decls> in do { <stmts2> } }
<decls> is a bunch of local declarations of values you want to define.
For example...
> let x = 5 in x + x
Cale> do { x <- [1..10]; let y = x^2; return y }
lambdabotParse error
Cale> do { x <- [1..10]; let {y = x^2}; return y }

Page: 2 9 16 23 30 37 44 51 58 65