Giter Site home page Giter Site logo

cond's People

Contributors

andreasabel avatar davecturner avatar erratic-pattern avatar owst avatar phadej avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cond's Issues

add to Stackage

Could you add cond to Stackage.org?

Otherwise I can also add it under my name.

Fails to build under GHC 7.6.1

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 ofBitwise', namely 0' In the expression: Bitwise 0 In an equation forfalse': false = Bitwise 0

Default implementation of && and ||

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?

|> does the opposite

-- |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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.