Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (13 sloc) 0.352 kB
module Head where
import Contracts
import Prelude (Bool(..),error)
head (x:xs) = x
head [] = error "empty list"
null [] = True
null xs = False
not True = False
not False = True
f . g = \x -> f (g x)
head_contract = head ::: CF :&: Pred (not . null) --> CF
head_broken_1 = head ::: CF --> CF
head_broken_2 = head ::: Pred (not . null) --> CF
Jump to Line
Something went wrong with that request. Please try again.