It looks like you're new here. If you want to get involved, click one of these buttons!

- All Categories 2.3K
- Chat 500
- Study Groups 19
- Petri Nets 9
- Epidemiology 4
- Leaf Modeling 1
- Review Sections 9
- MIT 2020: Programming with Categories 51
- MIT 2020: Lectures 20
- MIT 2020: Exercises 25
- MIT 2019: Applied Category Theory 339
- MIT 2019: Lectures 79
- MIT 2019: Exercises 149
- MIT 2019: Chat 50
- UCR ACT Seminar 4
- General 67
- Azimuth Code Project 110
- Statistical methods 4
- Drafts 2
- Math Syntax Demos 15
- Wiki - Latest Changes 3
- Strategy 113
- Azimuth Project 1.1K
- - Spam 1
- News and Information 147
- Azimuth Blog 149
- - Conventions and Policies 21
- - Questions 43
- Azimuth Wiki 713

Options

*The polymorphic type constructor Maybe.*

```
data Maybe a = Nothing | Just a
```

Ok, we have all the conceptual tools required to understand what this means.

A value of type "Maybe int" is either something like "Just 45", or else the constant Nothing.

So it's like the class of integers, plus some special designated null value, called Nothing.

"Just int" is the specific constructor that maps the integer "n" to the value term "Just n" which in turn belongs to the class of values for "Maybe int".

"Nothing" is the constructor that picks out the fixed constant Nothing.

"Maybe" is the polymorphic type constructor that maps type "a" to type "Maybe a".

Question: How are the semantics of Nothing handled, given that the type variable is not a parameter for this constructor? How do we arrive at a different Nothing constructor, for each instance of "Maybe a"?

<END-TALK/OPEN-DISCUSSION>

hello world×