erratic-pattern / cond Goto Github PK
View Code? Open in Web Editor NEWBasic conditional operators with monadic variants.
Home Page: http://hackage.haskell.org/package/cond
License: BSD 3-Clause "New" or "Revised" License
Basic conditional operators with monadic variants.
Home Page: http://hackage.haskell.org/package/cond
License: BSD 3-Clause "New" or "Revised" License
Could you add cond to Stackage.org?
Otherwise I can also add it under my name.
Hi,
your packages needs some work to work with a current GHC:
Preprocessing library cond-0.4.0.1...
[1 of 2] Compiling Data.Algebra.Boolean ( src/Data/Algebra/Boolean.hs, dist-ghc/build/Data/Algebra/Boo
lean.o )
src/Data/Algebra/Boolean.hs:125:20:
Could not deduce (Num a) arising from the literal 0' from the context (Bits a) bound by the instance declaration at src/Data/Algebra/Boolean.hs:123:10-38 Possible fix: add (Num a) to the context of the instance declaration In the first argument of
Bitwise', namely 0' In the expression: Bitwise 0 In an equation for
false': false = Bitwise 0
See ekmett's https://github.com/ekmett/ersatz/blob/master/src/Ersatz/Bit.hs#L196 which has an almost identical class with the capability of generic instances for Product types.
As I can see, default implementation of && and || operators is a:
x && y = not (x || y)
x || y = not (x && y)
But according to De Morgan's Law it must be like this:
x && y = not (not x || not y)
x || y = not (not x && not y)
Is this a mistake? Or can I don't understand some things?
Couldn't find a changelog for this package on hackage.
... on when
and unless
. They can just require Monad m
can't they?
Cheers,
-- |Right bracket of the conditional choice operator. If the predicate
-- is 'False', returns 'Nothing', otherwise it returns 'Just' the right-hand
-- argument.
(|>) :: ToBool bool => bool -> a -> Maybe a
p |> v = if' p Nothing (Just v)
{-# INLINE (|>) #-}
GHCI
*Main> True |> 1
Nothing
*Main> False |> 1
Just 1
Could you release the latest master version to the hackage?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.