A nullary type class for partial functions
Haskell
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 5 commits behind paf31:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
Setup.hs
partial.cabal

README.md

partial

A nullary type class for partial functions

Introduction

Use the Partial type class to track your partial functions. For example:

{-# LANGUAGE NullaryTypeClasses #-}

import Data.List.Partial

cadr :: (Partial) => [a] -> a
cadr = head . head

As an application developer, either opt into partial functions globally by declaring an instance of the Partial type class:

instance Partial

or run partial functions selectively using the partial function:

ghci> partial $ cadr [1, 2, 3]
2