Hi,
You're pretty close, actually. In general, remember the following:
'type' introduces a type synonym, which means that you're just renaming an
existing type, not creating a new one. this means that you don't need
constructors.
'data' means that you're defining a new type; in order to do
At 12:19 03/11/03 +, Patty Fong wrote:
prolog ::= (assertion .)*?xml:namespace prefix = o ns =
urn:schemas-microsoft-com:office:office /
[...]
type Prolog = Assertion
Did you mean this to be a *list* of Assertions? e.g.
type Prolog = [Assertion]
Otherwise, I think Hal's response covers
Hi All,
I was trying to write go program in haskell - My code fragment looks
like this -
getBoardSize :: IO Bool
-- TODO : What could be the type of getBoardSize
getBoardSize = do c - getLine
validateBoardSize ( atoi c )
-- Convert a string to an integer.
--
Hi,
On Mon, 3 Nov 2003, Karthik Kumar wrote:
-- Convert a string to an integer.
-- This works perfectly fine.
atoi :: [Char] - Int
atoi (h : []) = if isDigit h then digitToInt h else 0
atoi (h : t) = if isDigit h then digitToInt h * ( 10 ^ length t) +
atoi t else 0
you can use
Thanks a ton Hal for the quick clarification. It worked .
Cheers
Karthik.
--- Hal Daume III [EMAIL PROTECTED] wrote:
Hi,
On Mon, 3 Nov 2003, Karthik Kumar wrote:
-- Convert a string to an integer.
-- This works perfectly fine.
atoi :: [Char] - Int
atoi (h : []) = if
Hal Daume III wrote:
Hi,
On Mon, 3 Nov 2003, Karthik Kumar wrote:
-- Convert a string to an integer.
-- This works perfectly fine.
atoi :: [Char] - Int
atoi (h : []) = if isDigit h then digitToInt h else 0
atoi (h : t) = if isDigit h then digitToInt h * ( 10 ^ length t) +
atoi t else
Hi Artie,
You are right . I had changed the code as follows -
run = do c - getBoardSize
validateBoardSize c
-- Get the board size as input
getBoardSize :: IO ( Int )
validateBoardSize :: Int - IO ()
... and follows.
run function is the entry point.
Thanks for the clever code Oleg. I've tried to extend it again to track
the types of methods as well as just the names, giving a functional
dependancy from the class, method, and to result type. I can't get the
overlapping instances to work out, so I'm handing it back to a master,
and the rest of