Skip to content

MeetLambda/purescript-coercible

This branch is 3 commits ahead of Thimoteus/purescript-coercible:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Giuliano.Santandrea
Apr 25, 2020
15e66ca · Apr 25, 2020

History

10 Commits
Apr 25, 2020
Apr 25, 2020
Apr 18, 2020
Aug 1, 2017
Apr 13, 2016
Aug 1, 2017
Aug 1, 2017
Aug 1, 2017
Apr 18, 2020
Apr 18, 2020

Repository files navigation

purescript-coercible Build Status purescript-coercible on Pursuit

Fun with multi-parameter type classes!

This library provides a way to safely coerce values of some type into another type, when it makes sense.

Some sane default instances are provided, particularly for the primitive types.

You may wish to use this for newtype wrappers:

newtype Address = Address String

instance coercibleAddress :: Coercible Address String where
  coerce (Address s) = s

instance coercibleString :: Coercible String Address where
  coerce = Address

newtype Filepath = Filepath String

instance coercibleFilepathAddress :: Coercible Filepath Address where
  coerce (Filepath p) = Address p

install

bower i purescript-coercible

About

Fun with multi-parameter type classes!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PureScript 87.6%
  • Dhall 12.4%