Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tim Steenvoorden
clean-base
Commits
ee63cf34
Commit
ee63cf34
authored
Feb 08, 2016
by
Tim Steenvoorden
Browse files
add impossible to Data.Function
parent
24fccdb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Data/Function.dcl
View file @
ee63cf34
...
...
@@ -39,13 +39,14 @@ flip f :== g
where
g
b
a
=
f
a
b
// curry :: ((a, b) -> c) a b -> c
curry
f
a
b
:==
f
(
a
,
b
)
curry
f
a
b
:==
f
(
a
,
b
)
// uncurry :: (a b -> c) (a,b) -> c
uncurry
f
(
a
,
b
)
:==
f
a
b
uncurry
f
(
a
,
b
)
:==
f
a
b
(
`
on`
)
infixl
0
//:: (b b -> c) (a -> b) a a -> c
(
`
on`
)
g
f
:==
\
x
y
->
g
(
f
x
)
(
f
y
)
abort
::
!
String
->
.
a
undefined
::
.
a
impossible
::
.
a
src/Data/Function.icl
View file @
ee63cf34
...
...
@@ -9,4 +9,7 @@ abort s = code inline {
}
undefined
::
.
a
undefined
=
abort
"Run-time error! Program evaluated undefined value!"
undefined
=
abort
"Run-time error! Program evaluated an undefined value!"
impossible
::
.
a
impossible
=
abort
"Run-time error! Program reached an impossible branch!"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment