Just is the Maybe constructor that wraps a value of a parameterized type. A Maybe value is either Just a value or Nothing, allowing a function to represent failure or an optional result without crashing. section 3.3.2
Wrapping a parsed file path
A parser can return Just filePath when it receives one argument and Nothing otherwise: parseArguments [filePath] = Just filePath; parseArguments _ = Nothing. The result type is Maybe FilePath. section 3.3.2
Handle Just values through pattern matching and related Maybe operations:
- Match Just v to extract the wrapped value, and handle Nothing separately or provide a default. section 3.3.2
- Use fromMaybe to return the wrapped value or a fallback, such as fromMaybe 0 (Just 100) producing 100. section 3.3.2
- Pass Just or Nothing through a higher-order update function to add, update, or delete associative-list mappings. section 5.2
data Maybe a = Just a | Nothing
Inspect the definition data Maybe a = Just a | Nothing to see how Just carries a value while Nothing carries no further information. section 3.3.2

