menshen: Data Validation

[ bsd3, library, web ] [ Propose Tags ]

Data Validation inspired by JSR305


[Skip to Readme]
Versions [faq] 0.0.0, 0.0.1, 0.0.2, 0.0.3 (info)
Dependencies base (>=4.7 && <5), regex-tdfa (>=1.2.3.1 && <1.3), scientific (>=0.3.6.2 && <0.4), text (>=1.2.3.1 && <1.3) [details]
License BSD-3-Clause
Copyright (c) Daniel YU
Author Daniel YU
Maintainer leptonyu@gmail.com
Category Web
Home page https://github.com/leptonyu/menshen#readme
Uploaded by leptonyu at Thu Jan 17 03:51:22 UTC 2019
Distributions LTSHaskell:0.0.3, NixOS:0.0.3, Stackage:0.0.3
Downloads 786 total (87 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for menshen-0.0.0

[back to package description]

menshen

Hackage Build Status


λ> let value :: Int -> Either String Int; value = Right
λ> value 10 & maxInt 8
Left "must be less than or equal to 8"
λ> value 10 & maxInt 10
Right 10
λ> value 10 & maxInt 10 & minInt 8
Right 10
λ> value 9 & maxInt 10 & minInt 8
Right 9
λ> value 7 & maxInt 10 & minInt 8
Left "must be greater than or equal to 8"
λ> let str :: String -> Either String String; str = Right
λ> str "xxxx@gmail.com" & email
Right "xxxx@gmail.com"
λ> str "xxxx@gmail" & email
Left "must be a well-formed email address"
λ> str "123456789" & size (6,32)
Right "123456789"
λ> str "12345" & size (6,32)
Left "size must be between 6 and 32"