menshen: Data Validation

[ bsd3, deprecated, library, web ] [ Propose Tags ]
Deprecated

Data Validation inspired by JSR305


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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 2019-01-17T03:51:22Z
Distributions
Reverse Dependencies 4 direct, 7 indirect [details]
Downloads 1833 total (13 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

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"