3 ms·
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` s
by hrldcpr 2y ago
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?
- antonyt 2y agoLooks 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`.
- sieabahlpark 2y ago[dead]
- deleted 2y ago[deleted]
- chris_pie 2y agoI 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
- deleted 2y ago[deleted]
- mcbrit 2y agoYou are meant to feel it. Just: it does whatever is helpful.