Copyright | (c) Sirui Lu 2021-2023 |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | siruilu@cs.washington.edu |
Stability | Experimental |
Portability | GHC only |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- data a =-> b = TabularFun {
- funcTable :: [(a, b)]
- defaultFuncValue :: b
Documentation
data a =-> b infixr 0 Source #
Functions as a table. Use the #
operator to apply the function.
>>>
:set -XTypeOperators
>>>
let f = TabularFun [(1, 2), (3, 4)] 0 :: Int =-> Int
>>>
f # 1
2>>>
f # 2
0>>>
f # 3
4
TabularFun | |
|