Hacker News new | past | comments | ask | show | jobs | submit login

My Haskell is rusty—what does this line do?

    type Burrito = Meat option * Ingredient list
Does `*` create a tuple type?

Do lowercase `option` and `list` somehow specify `Option` and `List` types?




I think this is F#, not Haskell. '*' creates a product type, pretty sure it's a tuple in this case. "Meat option" is an alternative syntax for "Option<Meat>" and "Ingredient list" is a linked list of Ingredients


Looks more like F# (or something ML-y) than Haskell.

Yep, tuple or "product type."

Yep, in F# type annotations can be either in prefix style `List<T>` or postfix style `T list`.


You are meant to feel it. Just: it does whatever is helpful.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: