Dependent records
The projection functions needed `foo` -> `self .foo` in the types
This commit is contained in:
7
src/Data/List.newt
Normal file
7
src/Data/List.newt
Normal file
@@ -0,0 +1,7 @@
|
||||
module Data.List
|
||||
|
||||
import Prelude
|
||||
|
||||
lookup : ∀ a b. {{Eq a}} → a → List (a × b) → Maybe b
|
||||
lookup key Nil = Nothing
|
||||
lookup key ((k,v) :: rest) = if k == key then Just v else lookup key rest
|
||||
Reference in New Issue
Block a user