|
definition: |
lookup :: Eq a => a -> [(a, b)] -> Maybe b
lookup _ [] = Nothing
lookup k ((x,y):xys) | k == x = Just y
| otherwise = lookup k xys
|
|
demand: |
argument 3 |
|
deterministic: |
deterministic operation |
|
documentation: |
| Looks up a key in an association list. |
|
failfree: |
(_, _, _) |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_,{[]}) |-> {Nothing} || (_,_,{:}) |-> {Just,Nothing}}
|
|
name: |
lookup |
|
precedence: |
no precedence defined |
|
result-values: |
{Just,Nothing}
|
|
signature: |
Eq a => a -> [(a, b)] -> Maybe b |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
yes |
|
totally-defined: |
possibly non-reducible on same data term |