mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-23 19:54:50 +03:00
17 lines
290 B
Idris
17 lines
290 B
Idris
module Data.Linear.LMaybe
|
|
|
|
import Data.Linear.Notation
|
|
|
|
%default total
|
|
|
|
||| Linear version of Maybe
|
|
public export
|
|
data LMaybe : Type -> Type where
|
|
Nothing : LMaybe a
|
|
Just : a -@ LMaybe a
|
|
|
|
export
|
|
(<$>) : (a -@ b) -> LMaybe a -@ LMaybe b
|
|
f <$> Nothing = Nothing
|
|
f <$> Just x = Just (f x)
|