clash-prelude-1.2.5: CAES Language for Synchronous Hardware - Prelude library
Copyright(C) 2019 QBayLogic
LicenseBSD2 (see the file LICENSE)
MaintainerChristiaan Baaij <christiaan.baaij@gmail.com>
Safe HaskellNone
LanguageHaskell2010
Extensions
  • Cpp
  • ScopedTypeVariables
  • BangPatterns
  • ViewPatterns
  • DataKinds
  • InstanceSigs
  • StandaloneDeriving
  • DeriveDataTypeable
  • DeriveFunctor
  • DeriveTraversable
  • DeriveFoldable
  • DeriveGeneric
  • DefaultSignatures
  • DeriveLift
  • DerivingStrategies
  • FlexibleContexts
  • MagicHash
  • KindSignatures
  • TupleSections
  • TypeOperators
  • ExplicitNamespaces
  • ExplicitForAll
  • BinaryLiterals
  • TypeApplications

Clash.Class.Parity

Description

 
Synopsis

Documentation

class Parity a where Source #

Determine whether value is odd or even

Minimal complete definition

even | odd

Methods

even :: a -> Bool Source #

Check if value is even

>>> even (4 :: Unsigned 4)
True

odd :: a -> Bool Source #

Check if value is odd

>>> odd (4 :: Unsigned 4)
False

Instances

Instances details
Parity Bool Source # 
Instance details

Defined in Clash.Class.Parity

Methods

even :: Bool -> Bool Source #

odd :: Bool -> Bool Source #

Parity Int Source # 
Instance details

Defined in Clash.Class.Parity

Methods

even :: Int -> Bool Source #

odd :: Int -> Bool Source #

Parity Int8 Source # 
Instance details

Defined in Clash.Class.Parity

Methods

even :: Int8 -> Bool Source #

odd :: Int8 -> Bool Source #

Parity Int16 Source # 
Instance details

Defined in Clash.Class.Parity

Methods

even :: Int16 -> Bool Source #

odd :: Int16 -> Bool Source #

Parity Int32 Source # 
Instance details

Defined in Clash.Class.Parity

Methods

even :: Int32 -> Bool Source #

odd :: Int32 -> Bool Source #

Parity Int64 Source # 
Instance details

Defined in Clash.Class.Parity

Methods

even :: Int64 -> Bool Source #

odd :: Int64 -> Bool Source #

Parity Integer Source # 
Instance details

Defined in Clash.Class.Parity

Parity Word Source # 
Instance details

Defined in Clash.Class.Parity

Methods

even :: Word -> Bool Source #

odd :: Word -> Bool Source #

Parity Word8 Source # 
Instance details

Defined in Clash.Class.Parity

Methods

even :: Word8 -> Bool Source #

odd :: Word8 -> Bool Source #

Parity Word16 Source # 
Instance details

Defined in Clash.Class.Parity

Parity Word32 Source # 
Instance details

Defined in Clash.Class.Parity

Parity Word64 Source # 
Instance details

Defined in Clash.Class.Parity

Parity CUShort Source # 
Instance details

Defined in Clash.Class.Parity

KnownNat n => Parity (BitVector n) Source # 
Instance details

Defined in Clash.Class.Parity

(KnownNat n, 1 <= n) => Parity (Index n) Source # 
Instance details

Defined in Clash.Sized.Internal.Index

Methods

even :: Index n -> Bool Source #

odd :: Index n -> Bool Source #

KnownNat n => Parity (Unsigned n) Source # 
Instance details

Defined in Clash.Sized.Internal.Unsigned

Methods

even :: Unsigned n -> Bool Source #

odd :: Unsigned n -> Bool Source #

KnownNat n => Parity (Signed n) Source # 
Instance details

Defined in Clash.Sized.Internal.Signed

Methods

even :: Signed n -> Bool Source #

odd :: Signed n -> Bool Source #