Idris2-boot/tests/idris2/reg002/linm.idr
Edwin Brady 6f9cca6ce3 Change inference of function types in unification
Always infer a multiplicity of W. Since we can pass a linear function to
one which expects an unrestricted argument, this gives the more general
result if the multiplicity is otherwise unknown.
This makes things like 'maybe id (+) x y' type check again even in the
presence of an 'id' which is declared linear!
2020-01-27 17:54:21 +00:00

6 lines
86 B
Idris

import Data.List
maybeAdd : Maybe Int -> Int -> Int
maybeAdd x y = maybe id (+) x y