haskell - Code explanation -
i'm beginner, i'd me understand few lines of code
my questions are:
maybe string application of constructor maybe type string. mean? there equivalent in c language?
is function 3 arguments?
type t = [char] type p = (char, maybe string) type delta = ((maybe char, char), maybe string) fromgtom :: t -> [p] -> [delta]
is usage of above mentioned function?
fromgtom t p = terminalrules ++ varrules
i don't see why function has 3 arguments 2 used:
t
,p
.what
++
mean ?
sorry, posting many questions.
thanks in advance.
i attempt answer questions, better off reading book/finding tutorial.
maybe string
type indicates value may bestring
, or maynothing
. in c, kind of having string, givingnull
instead - except in haskell, information put in type, , if omittedmaybe
, not allowed usenothing
. there better explanation @ wikibooks.- no, function of 2 arguments, or function of 1 argument returns function of 1 argument. first argument list of
char
s (a string), , second list of 2-tuples ofchar
,maybe string
. last "argument" return type. currying more information. - no, possibly invalid definition of function (depending on type of
terminalrules
,varrules
). matter,t
,p
aren't used in definition;terminalrules
,varrules
being used instead. (++)
list concatenation operator.
Comments
Post a Comment