I am having issues with type signatures for the resourceHandler action
below. I haven't figured out what I'm doing wrong to cause the wrong
type to be returned. It looks like Haskell is inferring that I'm
returning a function from this action, when from the type signature I've
specified, that
-- type HttpMessage = Either HttpRequest HttpResponse
Now you can have functions that take/return just an HttpRequest or
just an HttpResponse, as well as functions that use either one via
HttpMessage. In the latter case, you do need to pattern match to
decide which one you have.
-- ryan
On 6/1
ow I should be specifying that. Ideas?
- Stephen
Brandon S. Allbery KF8NH wrote:
On Jun 18, 2008, at 15:31 , Stephen Howard wrote:
HttpMessage.hs:36:20: Not in scope: type constructor or class
`HttpRequest'
The troublesome line is the definition of the cookie function at the
end o
seemed to do more harm than good when it came to
legibility.
- Stephen
Jon Fairbairn wrote:
Stephen Howard <[EMAIL PROTECTED]> writes:
I am a newcomer doing my obligatory struggling with
Haskell's type system,
That's your mistake. Don't struggle with the type sys
hello list,
loading the code below into ghci gives me this error:
HttpMessage.hs:36:20: Not in scope: type constructor or class `HttpRequest'
The troublesome line is the definition of the cookie function at the end
of the code. I've made HttpRequest and HttpResponse constructors of
HttpMessa
Hi List,
I am a newcomer doing my obligatory struggling with Haskell's type
system, and I've got a nut I've not been able to crack. Given:
import Random
random_test :: Int -> String
random_test n = do
g <- getStdGen
take n (randoms g)::String
I'm expecting that I ought to be able to p