[Haskell-beginners] code explanation

David McBride dmcbride at neondsl.com
Sat Jul 2 18:54:28 CEST 2011


You really, really need to read a basic tutorial.  You are not going
to get anywhere in haskell trying to be spoonfed like this.

1) There might be nothing, or their might be a string.  No, not really.
2) No.
3) Yes.  You will find out within the first five paragraphs of any
haskell tutorial.
4) String concatenation.  You will learn how to look up functions in
said tutorial.

On Sat, Jul 2, 2011 at 12:47 PM,  <moowoo9 at fastmail.fm> wrote:
> I'm a beginner, I'd like someone to help me understand a few lines of code
> My questions are:
> 1) Maybe String is an application of the constructor Maybe to the type
> String.
> What does it mean? Is there anything equivalent in the C language?
> 2) Is this a function with three arguments?
> type T = [Char]
> type P = (Char, Maybe String)
> type Delta = ((Maybe Char, Char), Maybe String)
> fromGtoM :: T -> [P] -> [Delta]
> 3) is this a usage of the above mentioned function?
> fromGtoM t p = terminalRules ++ varRules
> I dont'see why the function has three arguments but then only
> two are used t p.
> 4) what does ++ mean ?
>
> Sorry, for posting too many questions.
> Thanks in advance.
> --
>
> moowoo9 at fastmail.fm
>
>
> --
> http://www.fastmail.fm - Access your email from home and the web
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>



More information about the Beginners mailing list