clash-prelude-1.8.4: Clash: a functional hardware description language - Prelude library

Copyright | (C) 2019 QBayLogic
License | BSD2 (see the file LICENSE)
Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com>
Safe Haskell | None
Language | Haskell2010

Extensions

- Cpp
- ScopedTypeVariables
- BangPatterns
- ViewPatterns
- DataKinds
- InstanceSigs
- StandaloneDeriving
- DeriveDataTypeable
- DeriveFunctor
- DeriveTraversable
- DeriveFoldable
- DeriveGeneric
- DefaultSignatures
- DeriveLift
- DerivingStrategies
- FlexibleContexts
- MagicHash
- KindSignatures
- PostfixOperators
- TupleSections
- TypeOperators
- ExplicitNamespaces
- ExplicitForAll
- BinaryLiterals
- TypeApplications

Clash.Class.Parity

Description

Synopsis

- class Parity a where
  - even :: a -> Bool
  - odd :: a -> Bool

# 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 CUShort Source # |
Instance details Defined in Clash.Class.Parity Methods even :: CUShort -> Bool Source # odd :: CUShort -> 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 Int8 Source # |
Instance details Defined in Clash.Class.Parity Methods even :: Int8 -> Bool Source # odd :: Int8 -> Bool Source #
Parity Word16 Source # |
Instance details Defined in Clash.Class.Parity Methods even :: Word16 -> Bool Source # odd :: Word16 -> Bool Source #
Parity Word32 Source # |
Instance details Defined in Clash.Class.Parity Methods even :: Word32 -> Bool Source # odd :: Word32 -> Bool Source #
Parity Word64 Source # |
Instance details Defined in Clash.Class.Parity Methods even :: Word64 -> Bool Source # odd :: Word64 -> Bool Source #
Parity Word8 Source # |
Instance details Defined in Clash.Class.Parity Methods even :: Word8 -> Bool Source # odd :: Word8 -> Bool Source #
Parity Integer Source # |
Instance details Defined in Clash.Class.Parity Methods even :: Integer -> Bool Source # odd :: Integer -> Bool Source #
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 Word Source # |
Instance details Defined in Clash.Class.Parity Methods even :: Word -> Bool Source # odd :: Word -> Bool Source #
Parity a => Parity (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods even :: Erroring a -> Bool Source # odd :: Erroring a -> Bool Source #
Parity a => Parity (Overflowing a) Source # |
Instance details Defined in Clash.Num.Overflowing Methods even :: Overflowing a -> Bool Source # odd :: Overflowing a -> Bool Source #
Parity a => Parity (Saturating a) Source # |
Instance details Defined in Clash.Num.Saturating Methods even :: Saturating a -> Bool Source # odd :: Saturating a -> Bool Source #
Parity a => Parity (Wrapping a) Source # |
Instance details Defined in Clash.Num.Wrapping Methods even :: Wrapping a -> Bool Source # odd :: Wrapping a -> Bool Source #
Parity a => Parity (Zeroing a) Source # |
Instance details Defined in Clash.Num.Zeroing Methods even :: Zeroing a -> Bool Source # odd :: Zeroing a -> Bool Source #
KnownNat n => Parity (BitVector n) Source # |
Instance details Defined in Clash.Class.Parity Methods even :: BitVector n -> Bool Source # odd :: BitVector n -> Bool Source #
(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 (Signed n) Source # |
Instance details Defined in Clash.Sized.Internal.Signed Methods even :: Signed n -> Bool Source # odd :: Signed 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 #