maybe-justify: Simple higher order function for Maybe

[ data, library, public-domain ] [ Propose Tags ]




Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS]
Dependencies base (>=4 && <5) [details]
License LicenseRef-PublicDomain
Author taksuyu
Category Data
Source repo head: git clone
Uploaded by taksuyu at 2015-06-24T20:45:30Z
Distributions NixOS:
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1006 total (6 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-06-24 [all 1 reports]

Readme for maybe-justify-

[back to package description]

Maybe you just need justify?

We've all used Maybe in a control flow

if f x then Just x else Nothing

but why not have

justify id f x

multiple constraints?

justify id (\a -> f a && g a) x

want a silly id for Maybe?

justify fromJust isJust (Just x)

This seems like such a no brainer that I'm surprised it isn't in Data.Maybe so I'm proposing that it should be and this library is just the start.

What about licensing issues?

Since I know there will be some talk about licensing, I already took the step and used the unlicense. If that isn't enough, just send a pull request changing it to an appropriate license and I'll accept.

What do I do while this isn't in Data.Maybe?

Then just go ahead and pull in maybe-justify from cabal!