clash-prelude-1.9.0: Clash: a functional hardware description language - Prelude library
Copyright(C) 2013-2016 University of Twente
2017 Google Inc.
2019 Myrtle Software Ltd
2021-2023 QBayLogic B.V.
2022 Myrtle.ai
LicenseBSD2 (see the file LICENSE)
MaintainerQBayLogic B.V. <devops@qbaylogic.com>
Safe HaskellUnsafe
LanguageHaskell2010
Extensions
  • Cpp
  • ScopedTypeVariables
  • BangPatterns
  • ViewPatterns
  • DataKinds
  • InstanceSigs
  • StandaloneDeriving
  • DeriveDataTypeable
  • DeriveFunctor
  • DeriveTraversable
  • DeriveFoldable
  • DeriveGeneric
  • DefaultSignatures
  • DeriveLift
  • DerivingStrategies
  • MagicHash
  • KindSignatures
  • PostfixOperators
  • TupleSections
  • TypeOperators
  • ExplicitNamespaces
  • ExplicitForAll
  • BinaryLiterals
  • TypeApplications

Clash.Explicit.Prelude

Description

This module defines the explicitly clocked counterparts of the functions defined in Clash.Prelude.

Synopsis

Creating synchronous sequential circuits

mealy Source #

Arguments

:: (KnownDomain dom, NFDataX s) 
=> Clock dom

Clock to synchronize to

-> Reset dom 
-> Enable dom

Global enable

-> (s -> i -> (s, o))

Transfer function in mealy machine form: state -> input -> (newstate,output)

-> s

Initial state

-> Signal dom i -> Signal dom o

Synchronous sequential function with input and output matching that of the mealy machine

Create a synchronous function from a combinational function describing a mealy machine

import qualified Data.List as L

macT
  :: Int        -- Current state
  -> (Int,Int)  -- Input
  -> (Int,Int)  -- (Updated state, output)
macT s (x,y) = (s',s)
  where
    s' = x * y + s

mac
  :: KnownDomain dom
  => Clock dom
  -> Reset dom
  -> Enable dom
  -> Signal dom (Int, Int)
  -> Signal dom Int
mac clk rst en = mealy clk rst en macT 0
>>> simulate (mac systemClockGen systemResetGen enableGen) [(0,0),(1,1),(2,2),(3,3),(4,4)]
[0,0,1,5,14...
...

Synchronous sequential functions can be composed just like their combinational counterpart:

dualMac
  :: KnownDomain dom
  => Clock dom
  -> Reset dom
  -> Enable dom
  -> (Signal dom Int, Signal dom Int)
  -> (Signal dom Int, Signal dom Int)
  -> Signal dom Int
dualMac clk rst en (a,b) (x,y) = s1 + s2
  where
    s1 = mealy clk rst en macT 0 (bundle (a,x))
    s2 = mealy clk rst en macT 0 (bundle (b,y))

mealyS Source #

Arguments

:: (KnownDomain dom, NFDataX s) 
=> Clock dom

Clock to synchronize to

-> Reset dom 
-> Enable dom

Global enable

-> (i -> State s o)

Transfer function in mealy machine handling inputs using Control.Monad.Strict.State s.

-> s

Initial state

-> Signal dom i -> Signal dom o

Synchronous sequential function with input and output matching that of the mealy machine

Create a synchronous function from a combinational function describing a mealy machine using the state monad. This can be particularly useful when combined with lenses or optics to replicate imperative algorithms.

data DelayState = DelayState
  { _history    :: Vec 4 Int
  , _untilValid :: Index 4
  }
  deriving (Generic, NFDataX)
makeLenses ''DelayState

initialDelayState = DelayState (repeat 0) maxBound

delayS :: Int -> State DelayState (Maybe Int)
delayS n = do
  history   %= (n +>>)
  remaining <- use untilValid
  if remaining > 0
  then do
     untilValid -= 1
     return Nothing
   else do
     out <- uses history last
     return (Just out)

delayTop ::KnownDomain dom
  => Clock dom
  -> Reset dom
  -> Enable dom
  -> (Signal dom Int -> Signal dom (Maybe Int))
delayTop clk rst en = mealyS clk rst en delayS initialDelayState
>>> L.take 7 $ simulate (delayTop systemClockGen systemResetGen enableGen) [-100,1,2,3,4,5,6,7,8]
[Nothing,Nothing,Nothing,Nothing,Just 1,Just 2,Just 3]

mealyB Source #

Arguments

:: (KnownDomain dom, NFDataX s, Bundle i, Bundle o) 
=> Clock dom 
-> Reset dom 
-> Enable dom 
-> (s -> i -> (s, o))

Transfer function in mealy machine form: state -> input -> (newstate,output)

-> s

Initial state

-> Unbundled dom i -> Unbundled dom o

Synchronous sequential function with input and output matching that of the mealy machine

A version of mealy that does automatic Bundleing

Given a function f of type:

f :: Int -> (Bool,Int) -> (Int,(Int,Bool))

When we want to make compositions of f in g using mealy, we have to write:

g clk rst en a b c = (b1,b2,i2)
  where
    (i1,b1) = unbundle (mealy clk rst en f 0 (bundle (a,b)))
    (i2,b2) = unbundle (mealy clk rst en f 3 (bundle (c,i1)))

Using mealyB however we can write:

g clk rst en a b c = (b1,b2,i2)
  where
    (i1,b1) = mealyB clk rst en f 0 (a,b)
    (i2,b2) = mealyB clk rst en f 3 (c,i1)

mealySB Source #

Arguments

:: (KnownDomain dom, NFDataX s, Bundle i, Bundle o) 
=> Clock dom 
-> Reset dom 
-> Enable dom 
-> (i -> State s o)

Transfer function in mealy machine handling inputs using Control.Monad.Strict.State s.

-> s

Initial state

-> Unbundled dom i -> Unbundled dom o

Synchronous sequential function with input and output matching that of the mealy machine

A version of mealyS that does automatic Bundleing, see mealyB for details.

moore Source #

Arguments

:: (KnownDomain dom, NFDataX s) 
=> Clock dom

Clock to synchronize to

-> Reset dom 
-> Enable dom 
-> (s -> i -> s)

Transfer function in moore machine form: state -> input -> newstate

-> (s -> o)

Output function in moore machine form: state -> output

-> s

Initial state

-> Signal dom i -> Signal dom o

Synchronous sequential function with input and output matching that of the moore machine

Create a synchronous function from a combinational function describing a moore machine

macT
  :: Int        -- Current state
  -> (Int,Int)  -- Input
  -> (Int,Int)  -- Updated state
macT s (x,y) = x * y + s

mac
  :: KnownDomain dom
  => Clock dom
  -> Reset dom
  -> Enable dom
  -> Signal dom (Int, Int)
  -> Signal dom Int
mac clk rst en = moore clk rst en macT id 0
>>> simulate (mac systemClockGen systemResetGen enableGen) [(0,0),(1,1),(2,2),(3,3),(4,4)]
[0,0,1,5,14...
...

Synchronous sequential functions can be composed just like their combinational counterpart:

dualMac
  :: KnownDomain dom
  => Clock dom
  -> Reset dom
  -> Enable dom
  -> (Signal dom Int, Signal dom Int)
  -> (Signal dom Int, Signal dom Int)
  -> Signal dom Int
dualMac clk rst en (a,b) (x,y) = s1 + s2
  where
    s1 = moore clk rst en macT id 0 (bundle (a,x))
    s2 = moore clk rst en macT id 0 (bundle (b,y))

mooreB Source #

Arguments

:: (KnownDomain dom, NFDataX s, Bundle i, Bundle o) 
=> Clock dom 
-> Reset dom 
-> Enable dom 
-> (s -> i -> s)

Transfer function in moore machine form: state -> input -> newstate

-> (s -> o)

Output function in moore machine form: state -> output

-> s

Initial state

-> Unbundled dom i -> Unbundled dom o

Synchronous sequential function with input and output matching that of the moore machine

A version of moore that does automatic Bundleing

Given a functions t and o of types:

t :: Int -> (Bool, Int) -> Int
o :: Int -> (Int, Bool)

When we want to make compositions of t and o in g using moore, we have to write:

g clk rst en a b c = (b1,b2,i2)
  where
    (i1,b1) = unbundle (moore clk rst en t o 0 (bundle (a,b)))
    (i2,b2) = unbundle (moore clk rst en t o 3 (bundle (c,i1)))

Using mooreB however we can write:

g clk rst en a b c = (b1,b2,i2)
  where
    (i1,b1) = mooreB clk rst en t o 0 (a,b)
    (i2,b2) = mooreB clk rst en t o 3 (c,i1)

registerB :: (KnownDomain dom, NFDataX a, Bundle a) => Clock dom -> Reset dom -> Enable dom -> a -> Unbundled dom a -> Unbundled dom a Source #

Create a register function for product-type like signals (e.g. (Signal a, Signal b))

rP :: Clock dom -> Reset dom -> Enable dom
   -> (Signal dom Int, Signal dom Int)
   -> (Signal dom Int, Signal dom Int)
rP clk rst en = registerB clk rst en (8,8)
>>> simulateB (rP systemClockGen systemResetGen enableGen) [(1,1),(1,1),(2,2),(3,3)] :: [(Int,Int)]
[(8,8),(8,8),(1,1),(2,2),(3,3)...
...

Synchronizer circuits for safe clock domain crossings

dualFlipFlopSynchronizer Source #

Arguments

:: (NFDataX a, KnownDomain dom1, KnownDomain dom2) 
=> Clock dom1

Clock to which the incoming data is synchronized

-> Clock dom2

Clock to which the outgoing data is synchronized

-> Reset dom2

Reset for registers on the outgoing domain

-> Enable dom2

Enable for registers on the outgoing domain

-> a

Initial value of the two synchronization registers

-> Signal dom1 a

Incoming data

-> Signal dom2 a

Outgoing, synchronized, data

Synchronizer based on two sequentially connected flip-flops.

  • NB: This synchronizer can be used for bit-synchronization.
  • NB: Although this synchronizer does reduce metastability, it does not guarantee the proper synchronization of a whole word. For example, given that the output is sampled twice as fast as the input is running, and we have two samples in the input stream that look like:

    [0111,1000]

    But the circuit driving the input stream has a longer propagation delay on msb compared to the lsbs. What can happen is an output stream that looks like this:

    [0111,0111,0000,1000]

    Where the level-change of the msb was not captured, but the level change of the lsbs were.

    If you want to have safe word-synchronization use asyncFIFOSynchronizer.

asyncFIFOSynchronizer Source #

Arguments

:: (KnownDomain wdom, KnownDomain rdom, 2 <= addrSize, NFDataX a) 
=> SNat addrSize

Size of the internally used addresses, the FIFO contains 2^addrSize elements.

-> Clock wdom

Clock to which the write port is synchronized

-> Clock rdom

Clock to which the read port is synchronized

-> Reset wdom 
-> Reset rdom 
-> Enable wdom 
-> Enable rdom 
-> Signal rdom Bool

Read request

-> Signal wdom (Maybe a)

Element to insert

-> (Signal rdom a, Signal rdom Bool, Signal wdom Bool)

(Oldest element in the FIFO, empty flag, full flag)

Synchronizer implemented as a FIFO around a synchronous RAM. Based on the design described in Clash.Tutorial, which is itself based on the design described in http://www.sunburst-design.com/papers/CummingsSNUG2002SJ_FIFO1.pdf. However, this FIFO uses a synchronous dual-ported RAM which, unlike those designs using RAM with an asynchronous read port, is nearly guaranteed to actually synthesize into one of the dual-ported RAMs found on most FPGAs.

NB: This synchronizer can be used for word-synchronization. NB: This synchronizer will only work safely when you set up the proper bus skew and maximum delay constraints inside your synthesis tool for the clock domain crossings of the gray pointers.

ROMs

asyncRom Source #

Arguments

:: (KnownNat n, Enum addr, NFDataX a) 
=> Vec n a

ROM content, also determines the size, n, of the ROM

NB: MUST be a constant

-> addr

Read address r

-> a

The value of the ROM at address r

An asynchronous/combinational ROM with space for n elements

See also:

asyncRomPow2 Source #

Arguments

:: (KnownNat n, NFDataX a) 
=> Vec (2 ^ n) a

ROM content

NB: MUST be a constant

-> Unsigned n

Read address r

-> a

The value of the ROM at address r

An asynchronous/combinational ROM with space for 2^n elements

See also:

rom Source #

Arguments

:: (KnownDomain dom, KnownNat n, NFDataX a, Enum addr) 
=> Clock dom

Clock to synchronize to

-> Enable dom

Enable line

-> Vec n a

ROM content, also determines the size, n, of the ROM

NB: MUST be a constant

-> Signal dom addr

Read address r

-> Signal dom a

The value of the ROM at address r from the previous clock cycle

A ROM with a synchronous read port, with space for n elements

  • NB: Read value is delayed by 1 cycle
  • NB: Initial output value is undefined, reading it will throw an XException

See also:

romPow2 Source #

Arguments

:: (KnownDomain dom, KnownNat n, NFDataX a) 
=> Clock dom

Clock to synchronize to

-> Enable dom

Enable line

-> Vec (2 ^ n) a

ROM content

NB: MUST be a constant

-> Signal dom (Unsigned n)

Read address r

-> Signal dom a

The value of the ROM at address r from the previous clock cycle

A ROM with a synchronous read port, with space for 2^n elements

  • NB: Read value is delayed by 1 cycle
  • NB: Initial output value is undefined, reading it will throw an XException

See also:

ROMs defined by a MemBlob

asyncRomBlob Source #

Arguments

:: Enum addr 
=> MemBlob n m

ROM content, also determines the size, n, of the ROM

NB: MUST be a constant

-> addr

Read address r

-> BitVector m

The value of the ROM at address r

An asynchronous/combinational ROM with space for n elements

See also:

asyncRomBlobPow2 Source #

Arguments

:: KnownNat n 
=> MemBlob (2 ^ n) m

ROM content, also determines the size, 2^n, of the ROM

NB: MUST be a constant

-> Unsigned n

Read address r

-> BitVector m

The value of the ROM at address r

An asynchronous/combinational ROM with space for 2^n elements

See also:

romBlob Source #

Arguments

:: forall dom addr m n. (KnownDomain dom, Enum addr) 
=> Clock dom

Clock to synchronize to

-> Enable dom

Enable line

-> MemBlob n m

ROM content, also determines the size, n, of the ROM

NB: MUST be a constant

-> Signal dom addr

Read address r

-> Signal dom (BitVector m)

The value of the ROM at address r from the previous clock cycle

A ROM with a synchronous read port, with space for n elements

  • NB: Read value is delayed by 1 cycle
  • NB: Initial output value is undefined, reading it will throw an XException

See also:

romBlobPow2 Source #

Arguments

:: forall dom m n. (KnownDomain dom, KnownNat n) 
=> Clock dom

Clock to synchronize to

-> Enable dom

Enable line

-> MemBlob (2 ^ n) m

ROM content, also determines the size, 2^n, of the ROM

NB: MUST be a constant

-> Signal dom (Unsigned n)

Read address r

-> Signal dom (BitVector m)

The value of the ROM at address r from the previous clock cycle

A ROM with a synchronous read port, with space for 2^n elements

  • NB: Read value is delayed by 1 cycle
  • NB: Initial output value is undefined, reading it will throw an XException

See also:

ROMs defined by a data file

asyncRomFile Source #

Arguments

:: (KnownNat m, Enum addr) 
=> SNat n

Size of the ROM

-> FilePath

File describing the content of the ROM

-> addr

Read address r

-> BitVector m

The value of the ROM at address r

An asynchronous/combinational ROM with space for n elements

  • NB: This function might not work for specific combinations of code-generation backends and hardware targets. Please check the support table below:
VHDLVerilogSystemVerilog
Altera/QuartusBrokenWorksWorks
Xilinx/ISEWorksWorksWorks
ASICUntestedUntestedUntested

See also:

  • See Clash.Prelude.ROM.File for more information on how to instantiate a ROM with the contents of a data file.
  • See Clash.Sized.Fixed for ideas on how to create your own data files.
  • When you notice that asyncRomFile is significantly slowing down your simulation, give it a monomorphic type signature. So instead of leaving the type to be inferred:

    myRomData = asyncRomFile d512 "memory.bin"
    

    or giving it a polymorphic type signature:

    myRomData :: Enum addr => addr -> BitVector 16
    myRomData = asyncRomFile d512 "memory.bin"
    

    you should give it a monomorphic type signature:

    myRomData :: Unsigned 9 -> BitVector 16
    myRomData = asyncRomFile d512 "memory.bin"
    

asyncRomFilePow2 Source #

Arguments

:: forall n m. (KnownNat m, KnownNat n) 
=> FilePath

File describing the content of the ROM

-> Unsigned n

Read address r

-> BitVector m

The value of the ROM at address r

An asynchronous/combinational ROM with space for 2^n elements

  • NB: This function might not work for specific combinations of code-generation backends and hardware targets. Please check the support table below:
VHDLVerilogSystemVerilog
Altera/QuartusBrokenWorksWorks
Xilinx/ISEWorksWorksWorks
ASICUntestedUntestedUntested

See also:

  • See Clash.Prelude.ROM.File for more information on how to instantiate a ROM with the contents of a data file.
  • See Clash.Sized.Fixed for ideas on how to create your own data files.
  • When you notice that asyncRomFilePow2 is significantly slowing down your simulation, give it a monomorphic type signature. So instead of leaving the type to be inferred:

    myRomData = asyncRomFilePow2 "memory.bin"
    

    you should give it a monomorphic type signature:

    myRomData :: Unsigned 9 -> BitVector 16
    myRomData = asyncRomFilePow2 "memory.bin"
    

romFile Source #

Arguments

:: (KnownNat m, Enum addr, KnownDomain dom) 
=> Clock dom

Clock to synchronize to

-> Enable dom

Enable line

-> SNat n

Size of the ROM

-> FilePath

File describing the content of the ROM

-> Signal dom addr

Read address r

-> Signal dom (BitVector m)

The value of the ROM at address r from the previous clock cycle

A ROM with a synchronous read port, with space for n elements

  • NB: Read value is delayed by 1 cycle
  • NB: Initial output value is undefined, reading it will throw an XException
  • NB: This function might not work for specific combinations of code-generation backends and hardware targets. Please check the support table below:
VHDLVerilogSystemVerilog
Altera/QuartusBrokenWorksWorks
Xilinx/ISEWorksWorksWorks
ASICUntestedUntestedUntested

See also:

romFilePow2 Source #

Arguments

:: forall dom n m. (KnownNat m, KnownNat n, KnownDomain dom) 
=> Clock dom

Clock to synchronize to

-> Enable dom

Enable line

-> FilePath

File describing the content of the ROM

-> Signal dom (Unsigned n)

Read address r

-> Signal dom (BitVector m)

The value of the ROM at address r from the previous clock cycle

A ROM with a synchronous read port, with space for 2^n elements

  • NB: Read value is delayed by 1 cycle
  • NB: Initial output value is undefined, reading it will throw an XException
  • NB: This function might not work for specific combinations of code-generation backends and hardware targets. Please check the support table below:
VHDLVerilogSystemVerilog
Altera/QuartusBrokenWorksWorks
Xilinx/ISEWorksWorksWorks
ASICUntestedUntestedUntested

See also:

RAM primitives with a combinational read port

asyncRam Source #

Arguments

:: (Enum addr, NFDataX addr, HasCallStack, KnownDomain wdom, KnownDomain rdom, NFDataX a) 
=> Clock wdom

Clock to which the write port of the RAM is synchronized

-> Clock rdom

Clock to which the read address signal, r, is synchronized

-> Enable wdom

Enable line for the write port

-> SNat n

Size n of the RAM

-> Signal rdom addr

Read address r

-> Signal wdom (Maybe (addr, a))

(write address w, value to write)

-> Signal rdom a

Value of the RAM at address r

Create a RAM with space for n elements

  • NB: Initial content of the RAM is undefined, reading it will throw an XException

See also:

asyncRamPow2 Source #

Arguments

:: forall wdom rdom n a. (KnownNat n, HasCallStack, KnownDomain wdom, KnownDomain rdom, NFDataX a) 
=> Clock wdom

Clock to which the write port of the RAM is synchronized

-> Clock rdom

Clock to which the read address signal, r, is synchronized

-> Enable wdom

Enable line for the write port

-> Signal rdom (Unsigned n)

Read address r

-> Signal wdom (Maybe (Unsigned n, a))

(write address w, value to write)

-> Signal rdom a

Value of the RAM at address r

Create a RAM with space for 2^n elements

  • NB: Initial content of the RAM is undefined, reading it will throw an XException

See also:

Block RAM primitives

blockRam Source #

Arguments

:: (KnownDomain dom, HasCallStack, NFDataX a, Enum addr, NFDataX addr) 
=> Clock dom

Clock to synchronize to

-> Enable dom

Enable line

-> Vec n a

Initial content of the BRAM, also determines the size, n, of the BRAM

NB: MUST be a constant

-> Signal dom addr

Read address r

-> Signal dom (Maybe (addr, a))

(write address w, value to write)

-> Signal dom a

Value of the BRAM at address r from the previous clock cycle

Create a block RAM with space for n elements

  • NB: Read value is delayed by 1 cycle
  • NB: Initial output value is undefined, reading it will throw an XException

See also:

  • See Clash.Explicit.BlockRam for more information on how to use a block RAM.
  • Use the adapter readNew for obtaining write-before-read semantics like this: readNew clk rst en (blockRam clk inits) rd wrM.
  • A large Vec for the initial content may be too inefficient, depending on how it is constructed. See blockRamFile and blockRamBlob for different approaches that scale well.

Example

Expand
bram40
  :: Clock  dom
  -> Enable  dom
  -> Signal dom (Unsigned 6)
  -> Signal dom (Maybe (Unsigned 6, Bit))
  -> Signal dom Bit
bram40 clk en = blockRam clk en (replicate d40 1)

blockRamPow2 Source #

Arguments

:: (KnownDomain dom, HasCallStack, NFDataX a, KnownNat n) 
=> Clock dom

Clock to synchronize to

-> Enable dom

Enable line

-> Vec (2 ^ n) a

Initial content of the BRAM

NB: MUST be a constant

-> Signal dom (Unsigned n)

Read address r

-> Signal dom (Maybe (Unsigned n, a))

(Write address w, value to write)

-> Signal dom a

Value of the BRAM at address r from the previous clock cycle

Create a block RAM with space for 2^n elements

  • NB: Read value is delayed by 1 cycle
  • NB: Initial output value is undefined, reading it will throw an XException

See also:

Example

Expand
bram32
  :: Clock dom
  -> Enable dom
  -> Signal dom (Unsigned 5)
  -> Signal dom (Maybe (Unsigned 5, Bit))
  -> Signal dom Bit
bram32 clk en = blockRamPow2 clk en (replicate d32 1)

blockRamU Source #

Arguments

:: forall n dom a r addr. (KnownDomain dom, HasCallStack, NFDataX a, Enum addr, NFDataX addr, 1 <= n) 
=> Clock dom

Clock to synchronize to

-> Reset dom

Reset line. This needs to be asserted for at least n cycles in order for the BRAM to be reset to its initial state.

-> Enable dom

Enable line

-> ResetStrategy r (Index n -> a)

Whether to clear BRAM on asserted reset (ClearOnReset) or not (NoClearOnReset). The reset needs to be asserted for at least n cycles to clear the BRAM.

-> SNat n

Number of elements in BRAM

-> Signal dom addr

Read address r

-> Signal dom (Maybe (addr, a))

(write address w, value to write)

-> Signal dom a

Value of the BRAM at address r from the previous clock cycle

A version of blockRam that has no default values set. May be cleared to an arbitrary state using a reset function.

blockRam1 Source #

Arguments

:: forall n dom a r addr. (KnownDomain dom, HasCallStack, NFDataX a, Enum addr, NFDataX addr, 1 <= n) 
=> Clock dom

Clock to synchronize to

-> Reset dom

Reset line. This needs to be asserted for at least n cycles in order for the BRAM to be reset to its initial state.

-> Enable dom

Enable line

-> ResetStrategy r ()

Whether to clear BRAM on asserted reset (ClearOnReset) or not (NoClearOnReset). The reset needs to be asserted for at least n cycles to clear the BRAM.

-> SNat n

Number of elements in BRAM

-> a

Initial content of the BRAM (replicated n times)

-> Signal dom addr

Read address r

-> Signal dom (Maybe (addr, a))

(write address w, value to write)

-> Signal dom a

Value of the BRAM at address r from the previous clock cycle

A version of blockRam that is initialized with the same value on all memory positions

data ResetStrategy (r :: Bool) a where Source #

Block RAM primitives initialized with a MemBlob

blockRamBlob Source #

Arguments

:: forall dom addr m n. (KnownDomain dom, Enum addr, NFDataX addr) 
=> Clock dom

Clock to synchronize to

-> Enable dom

Enable line

-> MemBlob n m

Initial content of the BRAM, also determines the size, n, of the BRAM

NB: MUST be a constant

-> Signal dom addr

Read address r

-> Signal dom (Maybe (addr, BitVector m))

(write address w, value to write)

-> Signal dom (BitVector m)

Value of the BRAM at address r from the previous clock cycle

Create a block RAM with space for n elements

  • NB: Read value is delayed by 1 cycle
  • NB: Initial output value is undefined, reading it will throw an XException

See also:

blockRamBlobPow2 Source #

Arguments

:: forall dom m n. (KnownDomain dom, KnownNat n) 
=> Clock dom

Clock to synchronize to

-> Enable dom

Enable line

-> MemBlob (2 ^ n) m

Initial content of the BRAM, also determines the size, 2^n, of the BRAM

NB: MUST be a constant

-> Signal dom (Unsigned n)

Read address r

-> Signal dom (Maybe (Unsigned n, BitVector m))

(write address w, value to write)

-> Signal dom (BitVector m)

Value of the BRAM at address r from the previous clock cycle

Create a block RAM with space for 2^n elements

  • NB: Read value is delayed by 1 cycle
  • NB: Initial output value is undefined, reading it will throw an XException

See also:

Creating and inspecting MemBlob

data MemBlob (n :: Nat) (m :: Nat) Source #

Efficient storage of memory content

It holds n words of BitVector m.

Instances

Instances details
Show (MemBlob n m) Source # 
Instance details

Defined in Clash.Explicit.BlockRam.Internal

Methods

showsPrec :: Int -> MemBlob n m -> ShowS Source #

show :: MemBlob n m -> String Source #

showList :: [MemBlob n m] -> ShowS Source #

createMemBlob Source #

Arguments

:: forall a f. (Foldable f, BitPack a) 
=> String

Name of the binding to generate

-> Maybe Bit

Value to map don't care bits to. Nothing means throwing an error on don't care bits.

-> f a

The content for the MemBlob

-> DecsQ 

Create a MemBlob binding from a list of values

Since this uses Template Haskell, nothing in the arguments given to createMemBlob can refer to something defined in the same module.

Example

Expand
createMemBlob "content" Nothing [15 :: Unsigned 8 .. 17]

ram clk en = blockRamBlob clk en content

The Maybe datatype has don't care bits, where the actual value does not matter. But the bits need a defined value in the memory. Either 0 or 1 can be used, and both are valid representations of the data.

>>> import qualified Prelude as P
>>> let es = [ Nothing, Just (7 :: Unsigned 8), Just 8 ]
>>> :{
createMemBlob "content0" (Just 0) es
createMemBlob "content1" (Just 1) es
x = 1
:}
>>> let pr = mapM_ (putStrLn . show)
>>> pr $ P.map pack es
0b0_...._....
0b1_0000_0111
0b1_0000_1000
>>> pr $ unpackMemBlob content0
0b0_0000_0000
0b1_0000_0111
0b1_0000_1000
>>> pr $ unpackMemBlob content1
0b0_1111_1111
0b1_0000_0111
0b1_0000_1000
>>> :{
createMemBlob "contentN" Nothing es
x = 1
:}

<interactive>:...: error:...
    packBVs: cannot convert don't care values. Please specify a mapping to a definite value.

Note how we hinted to clashi that our multi-line command was a list of declarations by including a dummy declaration x = 1. Without this trick, clashi would expect an expression and the Template Haskell would not work.

memBlobTH Source #

Arguments

:: forall a f. (Foldable f, BitPack a) 
=> Maybe Bit

Value to map don't care bits to. Nothing means throwing an error on don't care bits.

-> f a

The content for the MemBlob

-> ExpQ 

Create a MemBlob from a list of values

Since this uses Template Haskell, nothing in the arguments given to memBlobTH can refer to something defined in the same module.

Example

Expand
ram clk en = blockRamBlob clk en $(memBlobTH Nothing [15 :: Unsigned 8 .. 17])

The Maybe datatype has don't care bits, where the actual value does not matter. But the bits need a defined value in the memory. Either 0 or 1 can be used, and both are valid representations of the data.

>>> import qualified Prelude as P
>>> let es = [ Nothing, Just (7 :: Unsigned 8), Just 8 ]
>>> content0 = $(memBlobTH (Just 0) es)
>>> content1 = $(memBlobTH (Just 1) es)
>>> let pr = mapM_ (putStrLn . show)
>>> pr $ P.map pack es
0b0_...._....
0b1_0000_0111
0b1_0000_1000
>>> pr $ unpackMemBlob content0
0b0_0000_0000
0b1_0000_0111
0b1_0000_1000
>>> pr $ unpackMemBlob content1
0b0_1111_1111
0b1_0000_0111
0b1_0000_1000
>>> $(memBlobTH Nothing es)

<interactive>:...: error:...
    • packBVs: cannot convert don't care values. Please specify a mapping to a definite value.
    • In the untyped splice: $(memBlobTH Nothing es)

unpackMemBlob :: forall n m. MemBlob n m -> [BitVector m] Source #

Convert a MemBlob back to a list

NB: Not synthesizable

Block RAM primitives initialized with a data file

blockRamFile Source #

Arguments

:: (KnownDomain dom, KnownNat m, Enum addr, NFDataX addr, HasCallStack) 
=> Clock dom

Clock to synchronize to

-> Enable dom

Enable line

-> SNat n

Size of the BRAM

-> FilePath

File describing the initial content of the BRAM

-> Signal dom addr

Read address r

-> Signal dom (Maybe (addr, BitVector m))

(write address w, value to write)

-> Signal dom (BitVector m)

Value of the BRAM at address r from the previous clock cycle

Create a block RAM with space for n elements

  • NB: Read value is delayed by 1 cycle
  • NB: Initial output value is undefined, reading it will throw an XException
  • NB: This function might not work for specific combinations of code-generation backends and hardware targets. Please check the support table below:
VHDLVerilogSystemVerilog
Altera/QuartusBrokenWorksWorks
Xilinx/ISEWorksWorksWorks
ASICUntestedUntestedUntested

See also:

blockRamFilePow2 Source #

Arguments

:: forall dom n m. (KnownDomain dom, KnownNat m, KnownNat n, HasCallStack) 
=> Clock dom

Clock to synchronize to

-> Enable dom

Enable line

-> FilePath

File describing the initial content of the BRAM

-> Signal dom (Unsigned n)

Read address r

-> Signal dom (Maybe (Unsigned n, BitVector m))

(write address w, value to write)

-> Signal dom (BitVector m)

Value of the BRAM at address r from the previous clock cycle

Create a block RAM with space for 2^n elements

  • NB: Read value is delayed by 1 cycle
  • NB: Initial output value is undefined, reading it will throw an XException
  • NB: This function might not work for specific combinations of code-generation backends and hardware targets. Please check the support table below:
VHDLVerilogSystemVerilog
Altera/QuartusBrokenWorksWorks
Xilinx/ISEWorksWorksWorks
ASICUntestedUntestedUntested

See also:

  • See Clash.Prelude.BlockRam for more information on how to use a block RAM.
  • Use the adapter readNew for obtaining write-before-read semantics like this: readNew clk rst en (blockRamFilePow2' clk en file) rd wrM.
  • See Clash.Explicit.BlockRam.File for more information on how to instantiate a block RAM with the contents of a data file.
  • See memFile for creating a data file with Clash.
  • See Clash.Explicit.Fixed for more ideas on how to create your own data files.

Block RAM read/write conflict resolution

readNew Source #

Arguments

:: (KnownDomain dom, NFDataX a, Eq addr) 
=> Clock dom 
-> Reset dom 
-> Enable dom 
-> (Signal dom addr -> Signal dom (Maybe (addr, a)) -> Signal dom a)

The BRAM component

-> Signal dom addr

Read address r

-> Signal dom (Maybe (addr, a))

(Write address w, value to write)

-> Signal dom a

Value of the BRAM at address r from the previous clock cycle

Create a read-after-write block RAM from a read-before-write one

True dual-port block RAM

trueDualPortBlockRam Source #

Arguments

:: forall nAddrs domA domB a. (HasCallStack, KnownNat nAddrs, KnownDomain domA, KnownDomain domB, NFDataX a) 
=> Clock domA

Clock for port A

-> Clock domB

Clock for port B

-> Signal domA (RamOp nAddrs a)

RAM operation for port A

-> Signal domB (RamOp nAddrs a)

RAM operation for port B

-> (Signal domA a, Signal domB a)

Outputs data on next cycle. When writing, the data written will be echoed. When reading, the read data is returned.

Produces vendor-agnostic HDL that will be inferred as a true dual-port block RAM

Any value that is being written on a particular port is also the value that will be read on that port, i.e. the same-port read/write behavior is: WriteFirst. For mixed-port read/write, when port A writes to the address port B reads from, the output of port B is undefined, and vice versa.

data RamOp n a Source #

Port operation

Constructors

RamRead (Index n)

Read from address

RamWrite (Index n) a

Write data to address

RamNoOp

No operation

Instances

Instances details
Show a => Show (RamOp n a) Source # 
Instance details

Defined in Clash.Explicit.BlockRam

Methods

showsPrec :: Int -> RamOp n a -> ShowS Source #

show :: RamOp n a -> String Source #

showList :: [RamOp n a] -> ShowS Source #

Generic (RamOp n a) Source # 
Instance details

Defined in Clash.Explicit.BlockRam

Associated Types

type Rep (RamOp n a) :: Type -> Type Source #

Methods

from :: RamOp n a -> Rep (RamOp n a) x Source #

to :: Rep (RamOp n a) x -> RamOp n a Source #

NFDataX a => NFDataX (RamOp n a) Source # 
Instance details

Defined in Clash.Explicit.BlockRam

Methods

deepErrorX :: String -> RamOp n a Source #

hasUndefined :: RamOp n a -> Bool Source #

ensureSpine :: RamOp n a -> RamOp n a Source #

rnfX :: RamOp n a -> () Source #

(AutoReg a, KnownNat n) => AutoReg (RamOp n a) Source # 
Instance details

Defined in Clash.Explicit.BlockRam

Methods

autoReg :: forall (dom :: Domain). (HasCallStack, KnownDomain dom) => Clock dom -> Reset dom -> Enable dom -> RamOp n a -> Signal dom (RamOp n a) -> Signal dom (RamOp n a) Source #

type Rep (RamOp n a) Source # 
Instance details

Defined in Clash.Explicit.BlockRam

type Rep (RamOp n a) = D1 ('MetaData "RamOp" "Clash.Explicit.BlockRam" "clash-prelude-1.9.0-inplace" 'False) (C1 ('MetaCons "RamRead" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Index n))) :+: (C1 ('MetaCons "RamWrite" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Index n)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "RamNoOp" 'PrefixI 'False) (U1 :: Type -> Type)))

Utility functions

window Source #

Arguments

:: (KnownNat n, KnownDomain dom, NFDataX a, Default a) 
=> Clock dom

Clock to the incoming signal is synchronized

-> Reset dom 
-> Enable dom 
-> Signal dom a

Signal to create a window over

-> Vec (n + 1) (Signal dom a)

Window of at least size 1

Give a window over a Signal

@ window4

windowD Source #

Arguments

:: (KnownNat n, NFDataX a, Default a, KnownDomain dom) 
=> Clock dom

Clock to which the incoming signal is synchronized

-> Reset dom 
-> Enable dom 
-> Signal dom a

Signal to create a window over

-> Vec (n + 1) (Signal dom a)

Window of at least size 1

Give a delayed window over a Signal

windowD3
  :: KnownDomain dom
  -> Clock dom
  -> Enable dom
  -> Reset dom
  -> Signal dom Int
  -> Vec 3 (Signal dom Int)
windowD3 = windowD
>>> simulateB (windowD3 systemClockGen resetGen enableGen) [1::Int,1,2,3,4] :: [Vec 3 Int]
[0 :> 0 :> 0 :> Nil,0 :> 0 :> 0 :> Nil,1 :> 0 :> 0 :> Nil,2 :> 1 :> 0 :> Nil,3 :> 2 :> 1 :> Nil,4 :> 3 :> 2 :> Nil,...
...

isRising Source #

Arguments

:: (KnownDomain dom, NFDataX a, Bounded a, Eq a) 
=> Clock dom 
-> Reset dom 
-> Enable dom 
-> a

Starting value

-> Signal dom a 
-> Signal dom Bool 

Give a pulse when the Signal goes from minBound to maxBound

isFalling Source #

Arguments

:: (KnownDomain dom, NFDataX a, Bounded a, Eq a) 
=> Clock dom 
-> Reset dom 
-> Enable dom 
-> a

Starting value

-> Signal dom a 
-> Signal dom Bool 

Give a pulse when the Signal goes from maxBound to minBound

riseEvery :: forall dom n. KnownDomain dom => Clock dom -> Reset dom -> Enable dom -> SNat n -> Signal dom Bool Source #

Give a pulse every n clock cycles. This is a useful helper function when combined with functions like regEn or mux, in order to delay a register by a known amount.

oscillate :: forall dom n. KnownDomain dom => Clock dom -> Reset dom -> Enable dom -> Bool -> SNat n -> Signal dom Bool Source #

Oscillate a Bool for a given number of cycles, given the starting state.

Testbench functions

assert Source #

Arguments

:: (KnownDomain dom, Eq a, ShowX a) 
=> Clock dom 
-> Reset dom 
-> String

Additional message

-> Signal dom a

Checked value

-> Signal dom a

Expected value

-> Signal dom b

Return value

-> Signal dom b 

Compares the first two Signals for equality and logs a warning when they are not equal. The second Signal is considered the expected value. This function simply returns the third Signal unaltered as its result. This function is used by outputVerifier.

Usage in clashi

NB: When simulating a component that uses assert in clashi, usually, the warnings are only logged the first time the component is simulated. Issuing :reload in clashi will discard the cached result of the computation, and warnings will once again be emitted.

NB: This function can be used in synthesizable designs.

stimuliGenerator Source #

Arguments

:: forall l dom a. (KnownNat l, KnownDomain dom) 
=> Clock dom

Clock to which to synchronize the output signal

-> Reset dom 
-> Vec l a

Samples to generate

-> Signal dom a

Signal of given samples

Example:

testInput
  :: KnownDomain dom
  => Clock dom
  -> Reset dom
  -> Signal dom Int
testInput clk rst = stimuliGenerator clk rst $(listToVecTH [(1::Int),3..21])
>>> sampleN 14 (testInput systemClockGen resetGen)
[1,1,3,5,7,9,11,13,15,17,19,21,21,21]

outputVerifier' Source #

Arguments

:: forall l a dom. (KnownNat l, KnownDomain dom, Eq a, ShowX a, 1 <= l) 
=> Clock dom

Clock to which the test bench is synchronized

-> Reset dom

Reset line of test bench

-> Vec l a

Samples to compare with

-> Signal dom a

Signal to verify

-> Signal dom Bool

Indicator that all samples are verified

Same as outputVerifier but used in cases where the test bench domain and the domain of the circuit under test are the same.

Tracing

Simple

traceSignal1 Source #

Arguments

:: (BitPack a, NFDataX a, Typeable a) 
=> String

Name of signal in the VCD output

-> Signal dom a

Signal to trace

-> Signal dom a 

Trace a single signal. Will emit an error if a signal with the same name was previously registered.

NB: Associates the traced signal with a clock period of 1, which results in incorrect VCD files when working with circuits that have multiple clocks. Use traceSignal when working with circuits that have multiple clocks.

traceVecSignal1 Source #

Arguments

:: (KnownNat n, BitPack a, NFDataX a, Typeable a) 
=> String

Name of signal in debugging output. Will be appended by _0, _1, ..., _n.

-> Signal dom (Vec (n + 1) a)

Signal to trace

-> Signal dom (Vec (n + 1) a) 

Trace a single vector signal: each element in the vector will show up as a different trace. If the trace name already exists, this function will emit an error.

NB: Associates the traced signal with a clock period of 1, which results in incorrect VCD files when working with circuits that have multiple clocks. Use traceSignal when working with circuits that have multiple clocks.

Tracing in a multi-clock environment

traceSignal Source #

Arguments

:: forall dom a. (KnownDomain dom, BitPack a, NFDataX a, Typeable a) 
=> String

Name of signal in the VCD output

-> Signal dom a

Signal to trace

-> Signal dom a 

Trace a single signal. Will emit an error if a signal with the same name was previously registered.

NB: Works correctly when creating VCD files from traced signal in multi-clock circuits. However traceSignal1 might be more convenient to use when the domain of your circuit is polymorphic.

traceVecSignal Source #

Arguments

:: forall dom a n. (KnownDomain dom, KnownNat n, BitPack a, NFDataX a, Typeable a) 
=> String

Name of signal in debugging output. Will be appended by _0, _1, ..., _n.

-> Signal dom (Vec (n + 1) a)

Signal to trace

-> Signal dom (Vec (n + 1) a) 

Trace a single vector signal: each element in the vector will show up as a different trace. If the trace name already exists, this function will emit an error.

NB: Works correctly when creating VCD files from traced signal in multi-clock circuits. However traceSignal1 might be more convenient to use when the domain of your circuit is polymorphic.

VCD dump functions

dumpVCD Source #

Arguments

:: NFDataX a 
=> (Int, Int)

(offset, number of samples)

-> Signal dom a

(One of) the outputs of the circuit containing the traces

-> [String]

The names of the traces you definitely want to be dumped in the VCD file

-> IO (Either String Text) 

Produce a four-state VCD (Value Change Dump) according to IEEE 1364-{1995,2001}. This function fails if a trace name contains either non-printable or non-VCD characters.

Due to lazy evaluation, the created VCD files might not contain all the traces you were expecting. You therefore have to provide a list of names you definately want to be dumped in the VCD file.

For example:

vcd <- dumpVCD (0, 100) cntrOut ["main", "sub"]

Evaluates cntrOut long enough in order for to guarantee that the main, and sub traces end up in the generated VCD file.

Exported modules

Synchronous signals

Datatypes

Bit vectors

Arbitrary-width numbers

Fixed point numbers

Fixed size vectors

data Vec :: Nat -> Type -> Type where Source #

Fixed size vectors.

  • Lists with their length encoded in their type
  • Vector elements have an ASCENDING subscript starting from 0 and ending at length - 1.

Constructors

Nil :: Vec 0 a 
Cons :: a -> Vec n a -> Vec (n + 1) a infixr 5 

Bundled Patterns

pattern (:>) :: a -> Vec n a -> Vec (n + 1) a infixr 5

Add an element to the head of a vector.

>>> 3:>4:>5:>Nil
3 :> 4 :> 5 :> Nil
>>> let x = 3:>4:>5:>Nil
>>> :t x
x :: Num a => Vec 3 a

Can be used as a pattern:

>>> let f (x :> y :> _) = x + y
>>> :t f
f :: Num a => Vec ((n + 1) + 1) a -> a
>>> f (3:>4:>5:>6:>7:>Nil)
7

Also in conjunctions with (:<):

>>> let g (a :> b :> (_ :< y :< x)) = a + b +  x + y
>>> :t g
g :: Num a => Vec ((((n + 1) + 1) + 1) + 1) a -> a
>>> g (1:>2:>3:>4:>5:>Nil)
12
pattern (:<) :: Vec n a -> a -> Vec (n + 1) a infixl 5

Add an element to the tail of a vector.

>>> (3:>4:>5:>Nil) :< 1
3 :> 4 :> 5 :> 1 :> Nil
>>> let x = (3:>4:>5:>Nil) :< 1
>>> :t x
x :: Num a => Vec 4 a

Can be used as a pattern:

>>> let f (_ :< y :< x) = y + x
>>> :t f
f :: Num a => Vec ((n + 1) + 1) a -> a
>>> f (3:>4:>5:>6:>7:>Nil)
13

Also in conjunctions with (:>):

>>> let g (a :> b :> (_ :< y :< x)) = a + b +  x + y
>>> :t g
g :: Num a => Vec ((((n + 1) + 1) + 1) + 1) a -> a
>>> g (1:>2:>3:>4:>5:>Nil)
12

Instances

Instances details
Lift a => Lift (Vec n a :: Type) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

lift :: Vec n a -> Q Exp Source #

liftTyped :: Vec n a -> Q (TExp (Vec n a)) Source #

Functor (Vec n) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

fmap :: (a -> b) -> Vec n a -> Vec n b Source #

(<$) :: a -> Vec n b -> Vec n a Source #

KnownNat n => Applicative (Vec n) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

pure :: a -> Vec n a Source #

(<*>) :: Vec n (a -> b) -> Vec n a -> Vec n b Source #

liftA2 :: (a -> b -> c) -> Vec n a -> Vec n b -> Vec n c Source #

(*>) :: Vec n a -> Vec n b -> Vec n b Source #

(<*) :: Vec n a -> Vec n b -> Vec n a Source #

KnownNat n => Foldable (Vec n) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

fold :: Monoid m => Vec n m -> m Source #

foldMap :: Monoid m => (a -> m) -> Vec n a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Vec n a -> m Source #

foldr :: (a -> b -> b) -> b -> Vec n a -> b Source #

foldr' :: (a -> b -> b) -> b -> Vec n a -> b Source #

foldl :: (b -> a -> b) -> b -> Vec n a -> b Source #

foldl' :: (b -> a -> b) -> b -> Vec n a -> b Source #

foldr1 :: (a -> a -> a) -> Vec n a -> a Source #

foldl1 :: (a -> a -> a) -> Vec n a -> a Source #

toList :: Vec n a -> [a] Source #

null :: Vec n a -> Bool Source #

length :: Vec n a -> Int Source #

elem :: Eq a => a -> Vec n a -> Bool Source #

maximum :: Ord a => Vec n a -> a Source #

minimum :: Ord a => Vec n a -> a Source #

sum :: Num a => Vec n a -> a Source #

product :: Num a => Vec n a -> a Source #

KnownNat n => Traversable (Vec n) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

traverse :: Applicative f => (a -> f b) -> Vec n a -> f (Vec n b) Source #

sequenceA :: Applicative f => Vec n (f a) -> f (Vec n a) Source #

mapM :: Monad m => (a -> m b) -> Vec n a -> m (Vec n b) Source #

sequence :: Monad m => Vec n (m a) -> m (Vec n a) Source #

KnownNat n => Distributive (Vec n) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

distribute :: Functor f => f (Vec n a) -> Vec n (f a) Source #

collect :: Functor f => (a -> Vec n b) -> f a -> Vec n (f b) Source #

distributeM :: Monad m => m (Vec n a) -> Vec n (m a) Source #

collectM :: Monad m => (a -> Vec n b) -> m a -> Vec n (m b) Source #

KnownNat n => Representable (Vec n) Source # 
Instance details

Defined in Clash.Sized.Vector

Associated Types

type Rep (Vec n) Source #

Methods

tabulate :: (Rep (Vec n) -> a) -> Vec n a Source #

index :: Vec n a -> Rep (Vec n) -> a Source #

(KnownNat n, Eq a) => Eq (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

(==) :: Vec n a -> Vec n a -> Bool Source #

(/=) :: Vec n a -> Vec n a -> Bool Source #

(KnownNat n, Typeable a, Data a) => Data (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Vec n a -> c (Vec n a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Vec n a) Source #

toConstr :: Vec n a -> Constr Source #

dataTypeOf :: Vec n a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Vec n a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Vec n a)) Source #

gmapT :: (forall b. Data b => b -> b) -> Vec n a -> Vec n a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Vec n a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Vec n a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Vec n a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Vec n a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Vec n a -> m (Vec n a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Vec n a -> m (Vec n a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Vec n a -> m (Vec n a) Source #

(KnownNat n, Ord a) => Ord (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

compare :: Vec n a -> Vec n a -> Ordering Source #

(<) :: Vec n a -> Vec n a -> Bool Source #

(<=) :: Vec n a -> Vec n a -> Bool Source #

(>) :: Vec n a -> Vec n a -> Bool Source #

(>=) :: Vec n a -> Vec n a -> Bool Source #

max :: Vec n a -> Vec n a -> Vec n a Source #

min :: Vec n a -> Vec n a -> Vec n a Source #

Show a => Show (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

showsPrec :: Int -> Vec n a -> ShowS Source #

show :: Vec n a -> String Source #

showList :: [Vec n a] -> ShowS Source #

KnownNat n => Generic (Vec n a) Source #

In many cases, this Generic instance only allows generic functions/instances over vectors of at least size 1, due to the n-1 in the Rep (Vec n a) definition.

We'll have to wait for things like https://ryanglscott.github.io/2018/02/11/how-to-derive-generic-for-some-gadts/ before we can work around this limitation

Instance details

Defined in Clash.Sized.Vector

Associated Types

type Rep (Vec n a) :: Type -> Type Source #

Methods

from :: Vec n a -> Rep (Vec n a) x Source #

to :: Rep (Vec n a) x -> Vec n a Source #

(KnownNat n, Semigroup a) => Semigroup (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

(<>) :: Vec n a -> Vec n a -> Vec n a Source #

sconcat :: NonEmpty (Vec n a) -> Vec n a Source #

stimes :: Integral b => b -> Vec n a -> Vec n a Source #

(KnownNat n, Monoid a) => Monoid (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

mempty :: Vec n a Source #

mappend :: Vec n a -> Vec n a -> Vec n a Source #

mconcat :: [Vec n a] -> Vec n a Source #

(KnownNat n, Arbitrary a) => Arbitrary (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

arbitrary :: Gen (Vec n a) Source #

shrink :: Vec n a -> [Vec n a] Source #

CoArbitrary a => CoArbitrary (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

coarbitrary :: Vec n a -> Gen b -> Gen b Source #

(Default a, KnownNat n) => Default (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

def :: Vec n a Source #

NFData a => NFData (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

rnf :: Vec n a -> () Source #

KnownNat n => Ixed (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

ix :: Index (Vec n a) -> Traversal' (Vec n a) (IxValue (Vec n a)) Source #

(NFDataX a, KnownNat n) => NFDataX (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

deepErrorX :: String -> Vec n a Source #

hasUndefined :: Vec n a -> Bool Source #

ensureSpine :: Vec n a -> Vec n a Source #

rnfX :: Vec n a -> () Source #

ShowX a => ShowX (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

showsPrecX :: Int -> Vec n a -> ShowS Source #

showX :: Vec n a -> String Source #

showListX :: [Vec n a] -> ShowS Source #

(KnownNat n, BitPack a) => BitPack (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

Associated Types

type BitSize (Vec n a) :: Nat Source #

Methods

pack :: Vec n a -> BitVector (BitSize (Vec n a)) Source #

unpack :: BitVector (BitSize (Vec n a)) -> Vec n a Source #

VecToTuple (Vec 0 a) Source # 
Instance details

Defined in Clash.Sized.Vector.ToTuple

Associated Types

type TupType (Vec 0 a) = (r :: Type) Source #

Methods

vecToTuple :: Vec 0 a -> TupType (Vec 0 a) Source #

VecToTuple (Vec 2 a) Source #

NB: The documentation only shows instances up to 3-tuples. By default, instances up to and including 12-tuples will exist. If the flag large-tuples is set instances up to the GHC imposed limit will exist. The GHC imposed limit is either 62 or 64 depending on the GHC version.

Instance details

Defined in Clash.Sized.Vector.ToTuple

Associated Types

type TupType (Vec 2 a) = (r :: Type) Source #

Methods

vecToTuple :: Vec 2 a -> TupType (Vec 2 a) Source #

VecToTuple (Vec 3 a) Source # 
Instance details

Defined in Clash.Sized.Vector.ToTuple

Associated Types

type TupType (Vec 3 a) = (r :: Type) Source #

Methods

vecToTuple :: Vec 3 a -> TupType (Vec 3 a) Source #

KnownNat n => Bundle (Vec n a) Source # 
Instance details

Defined in Clash.Signal.Bundle

Associated Types

type Unbundled dom (Vec n a) = (res :: Type) Source #

Methods

bundle :: forall (dom :: Domain). Unbundled dom (Vec n a) -> Signal dom (Vec n a) Source #

unbundle :: forall (dom :: Domain). Signal dom (Vec n a) -> Unbundled dom (Vec n a) Source #

(Counter a, KnownNat n, 1 <= n) => Counter (Vec n a) Source #

Counters on vectors increment from right to left.

>>> type T = Vec 2 (Index 10)
>>> countSucc @T (0 :> 0 :> Nil)
0 :> 1 :> Nil
>>> countSucc @T (0 :> 1 :> Nil)
0 :> 2 :> Nil
>>> countSucc @T (0 :> 9 :> Nil)
1 :> 0 :> Nil
>>> iterate (SNat @5) (countSucc @T) (9 :> 8 :> Nil)
(9 :> 8 :> Nil) :> (9 :> 9 :> Nil) :> (0 :> 0 :> Nil) :> (0 :> 1 :> Nil) :> (0 :> 2 :> Nil) :> Nil
Instance details

Defined in Clash.Class.Counter.Internal

Methods

countMin :: Vec n a Source #

countMax :: Vec n a Source #

countSuccOverflow :: Vec n a -> (Bool, Vec n a) Source #

countPredOverflow :: Vec n a -> (Bool, Vec n a) Source #

(KnownNat n, AutoReg a) => AutoReg (Vec n a) Source # 
Instance details

Defined in Clash.Class.AutoReg.Internal

Methods

autoReg :: forall (dom :: Domain). (HasCallStack, KnownDomain dom) => Clock dom -> Reset dom -> Enable dom -> Vec n a -> Signal dom (Vec n a) -> Signal dom (Vec n a) Source #

KnownNat n => Bundle (Vec n a) Source # 
Instance details

Defined in Clash.Signal.Delayed.Bundle

Associated Types

type Unbundled dom d (Vec n a) = (res :: Type) Source #

Methods

bundle :: forall (dom :: Domain) (d :: Nat). Unbundled dom d (Vec n a) -> DSignal dom d (Vec n a) Source #

unbundle :: forall (dom :: Domain) (d :: Nat). DSignal dom d (Vec n a) -> Unbundled dom d (Vec n a) Source #

(LockStep en a, KnownNat n) => LockStep (Vec n en) (Vec n a) Source # 
Instance details

Defined in Clash.Prelude.DataFlow

Methods

lockStep :: forall (dom :: Domain). DataFlow dom (Vec n en) Bool (Vec n a) (Vec n a) Source #

stepLock :: forall (dom :: Domain). DataFlow dom Bool (Vec n en) (Vec n a) (Vec n a) Source #

type Unbundled t d (Vec n a) Source # 
Instance details

Defined in Clash.Signal.Delayed.Bundle

type Unbundled t d (Vec n a) = Vec n (DSignal t d a)
type HasDomain dom (Vec n a) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSpecificDomain

type HasDomain dom (Vec n a) = HasDomain dom a
type Unbundled t (Vec n a) Source # 
Instance details

Defined in Clash.Signal.Bundle

type Unbundled t (Vec n a) = Vec n (Signal t a)
type TryDomain t (Vec n a) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Vec n a) = TryDomain t a
type Rep (Vec n) Source # 
Instance details

Defined in Clash.Sized.Vector

type Rep (Vec n) = Index n
type Rep (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

type Rep (Vec n a) = D1 ('MetaData "Vec" "Clash.Data.Vector" "clash-prelude" 'False) (C1 ('MetaCons "Nil" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Cons" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vec (n - 1) a))))
type Index (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

type Index (Vec n a) = Index n
type IxValue (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

type IxValue (Vec n a) = a
type BitSize (Vec n a) Source # 
Instance details

Defined in Clash.Sized.Vector

type BitSize (Vec n a) = n * BitSize a
type TupType (Vec 0 a) Source # 
Instance details

Defined in Clash.Sized.Vector.ToTuple

type TupType (Vec 0 a) = Tagged a ()
type TupType (Vec 2 a) Source # 
Instance details

Defined in Clash.Sized.Vector.ToTuple

type TupType (Vec 2 a) = (a, a)
type TupType (Vec 3 a) Source # 
Instance details

Defined in Clash.Sized.Vector.ToTuple

type TupType (Vec 3 a) = (a, a, a)

foldl :: forall b a n. (b -> a -> b) -> b -> Vec n a -> b Source #

foldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a vector, reduces the vector using the binary operator, from left to right:

foldl f z (x1 :> x2 :> ... :> xn :> Nil) == (...((z `f` x1) `f` x2) `f`...) `f` xn
foldl f z Nil                            == z
>>> foldl (/) 1 (5 :> 4 :> 3 :> 2 :> Nil)
8.333333333333333e-3

"foldl f z xs" corresponds to the following circuit layout:

NB: "foldl f z xs" produces a linear structure, which has a depth, or delay, of O(length xs). Use fold if your binary operator f is associative, as "fold f xs" produces a structure with a depth of O(log_2(length xs)).

foldr :: (a -> b -> b) -> b -> Vec n a -> b Source #

foldr, applied to a binary operator, a starting value (typically the right-identity of the operator), and a vector, reduces the vector using the binary operator, from right to left:

foldr f z (x1 :> ... :> xn1 :> xn :> Nil) == x1 `f` (... (xn1 `f` (xn `f` z))...)
foldr r z Nil                             == z
>>> foldr (/) 1 (5 :> 4 :> 3 :> 2 :> Nil)
1.875

"foldr f z xs" corresponds to the following circuit layout:

NB: "foldr f z xs" produces a linear structure, which has a depth, or delay, of O(length xs). Use fold if your binary operator f is associative, as "fold f xs" produces a structure with a depth of O(log_2(length xs)).

map :: (a -> b) -> Vec n a -> Vec n b Source #

"map f xs" is the vector obtained by applying f to each element of xs, i.e.,

map f (x1 :> x2 :>  ... :> xn :> Nil) == (f x1 :> f x2 :> ... :> f xn :> Nil)

and corresponds to the following circuit layout:

bv2v :: KnownNat n => BitVector n -> Vec n Bit Source #

Convert a BitVector to a Vec of Bits.

>>> let x = 6 :: BitVector 8
>>> x
0b0000_0110
>>> bv2v x
0 :> 0 :> 0 :> 0 :> 0 :> 1 :> 1 :> 0 :> Nil

data VCons (a :: Type) (f :: TyFun Nat Type) :: Type Source #

To be used as the motive p for dfold, when the f in "dfold p f" is a variation on (:>), e.g.:

map' :: forall n a b . KnownNat n => (a -> b) -> Vec n a -> Vec n b
map' f = dfold (Proxy @(VCons b)) (_ x xs -> f x :> xs)

Instances

Instances details
type Apply (VCons a :: TyFun Nat Type -> Type) (l :: Nat) Source # 
Instance details

Defined in Clash.Sized.Vector

type Apply (VCons a :: TyFun Nat Type -> Type) (l :: Nat) = Vec l a

traverse# :: forall a f b n. Applicative f => (a -> f b) -> Vec n a -> f (Vec n b) Source #

singleton :: a -> Vec 1 a Source #

Create a vector of one element

>>> singleton 5
5 :> Nil

head :: Vec (n + 1) a -> a Source #

Extract the first element of a vector

>>> head (1:>2:>3:>Nil)
1
>>> head Nil

<interactive>:...
    • Couldn't match type ‘1’ with ‘0’
      Expected type: Vec (0 + 1) a
        Actual type: Vec 0 a
    • In the first argument of ‘head’, namely ‘Nil’
      In the expression: head Nil
      In an equation for ‘it’: it = head Nil

tail :: Vec (n + 1) a -> Vec n a Source #

Extract the elements after the head of a vector

>>> tail (1:>2:>3:>Nil)
2 :> 3 :> Nil
>>> tail Nil

<interactive>:...
    • Couldn't match type ‘1’ with ‘0’
      Expected type: Vec (0 + 1) a
        Actual type: Vec 0 a
    • In the first argument of ‘tail’, namely ‘Nil’
      In the expression: tail Nil
      In an equation for ‘it’: it = tail Nil

last :: Vec (n + 1) a -> a Source #

Extract the last element of a vector

>>> last (1:>2:>3:>Nil)
3
>>> last Nil

<interactive>:...
    • Couldn't match type ‘1’ with ‘0’
      Expected type: Vec (0 + 1) a
        Actual type: Vec 0 a
    • In the first argument of ‘last’, namely ‘Nil’
      In the expression: last Nil
      In an equation for ‘it’: it = last Nil

init :: Vec (n + 1) a -> Vec n a Source #

Extract all the elements of a vector except the last element

>>> init (1:>2:>3:>Nil)
1 :> 2 :> Nil
>>> init Nil

<interactive>:...
    • Couldn't match type ‘1’ with ‘0’
      Expected type: Vec (0 + 1) a
        Actual type: Vec 0 a
    • In the first argument of ‘init’, namely ‘Nil’
      In the expression: init Nil
      In an equation for ‘it’: it = init Nil

shiftInAt0 Source #

Arguments

:: KnownNat n 
=> Vec n a

The old vector

-> Vec m a

The elements to shift in at the head

-> (Vec n a, Vec m a)

(The new vector, shifted out elements)

Shift in elements to the head of a vector, bumping out elements at the tail. The result is a tuple containing:

  • The new vector
  • The shifted out elements
>>> shiftInAt0 (1 :> 2 :> 3 :> 4 :> Nil) ((-1) :> 0 :> Nil)
(-1 :> 0 :> 1 :> 2 :> Nil,3 :> 4 :> Nil)
>>> shiftInAt0 (1 :> Nil) ((-1) :> 0 :> Nil)
(-1 :> Nil,0 :> 1 :> Nil)

shiftInAtN Source #

Arguments

:: KnownNat m 
=> Vec n a

The old vector

-> Vec m a

The elements to shift in at the tail

-> (Vec n a, Vec m a)

(The new vector, shifted out elements)

Shift in element to the tail of a vector, bumping out elements at the head. The result is a tuple containing:

  • The new vector
  • The shifted out elements
>>> shiftInAtN (1 :> 2 :> 3 :> 4 :> Nil) (5 :> 6 :> Nil)
(3 :> 4 :> 5 :> 6 :> Nil,1 :> 2 :> Nil)
>>> shiftInAtN (1 :> Nil) (2 :> 3 :> Nil)
(3 :> Nil,1 :> 2 :> Nil)

(+>>) :: KnownNat n => a -> Vec n a -> Vec n a infixr 4 Source #

Add an element to the head of a vector, and extract all but the last element.

>>> 1 +>> (3:>4:>5:>Nil)
1 :> 3 :> 4 :> Nil
>>> 1 +>> Nil
Nil

(<<+) :: Vec n a -> a -> Vec n a infixl 4 Source #

Add an element to the tail of a vector, and extract all but the first element.

>>> (3:>4:>5:>Nil) <<+ 1
4 :> 5 :> 1 :> Nil
>>> Nil <<+ 1
Nil

shiftOutFrom0 Source #

Arguments

:: (Default a, KnownNat m) 
=> SNat m

m, the number of elements to shift out

-> Vec (m + n) a

The old vector

-> (Vec (m + n) a, Vec m a)

(The new vector, shifted out elements)

Shift m elements out from the head of a vector, filling up the tail with Default values. The result is a tuple containing:

  • The new vector
  • The shifted out values
>>> shiftOutFrom0 d2 ((1 :> 2 :> 3 :> 4 :> 5 :> Nil) :: Vec 5 Integer)
(3 :> 4 :> 5 :> 0 :> 0 :> Nil,1 :> 2 :> Nil)

shiftOutFromN Source #

Arguments

:: (Default a, KnownNat n) 
=> SNat m

m, the number of elements to shift out

-> Vec (m + n) a

The old vector

-> (Vec (m + n) a, Vec m a)

(The new vector, shifted out elements)

Shift m elements out from the tail of a vector, filling up the head with Default values. The result is a tuple containing:

  • The new vector
  • The shifted out values
>>> shiftOutFromN d2 ((1 :> 2 :> 3 :> 4 :> 5 :> Nil) :: Vec 5 Integer)
(0 :> 0 :> 1 :> 2 :> 3 :> Nil,4 :> 5 :> Nil)

(++) :: Vec n a -> Vec m a -> Vec (n + m) a infixr 5 Source #

Append two vectors.

>>> (1:>2:>3:>Nil) ++ (7:>8:>Nil)
1 :> 2 :> 3 :> 7 :> 8 :> Nil

splitAt :: SNat m -> Vec (m + n) a -> (Vec m a, Vec n a) Source #

Split a vector into two vectors at the given point.

>>> splitAt (SNat :: SNat 3) (1:>2:>3:>7:>8:>Nil)
(1 :> 2 :> 3 :> Nil,7 :> 8 :> Nil)
>>> splitAt d3 (1:>2:>3:>7:>8:>Nil)
(1 :> 2 :> 3 :> Nil,7 :> 8 :> Nil)

splitAtI :: KnownNat m => Vec (m + n) a -> (Vec m a, Vec n a) Source #

Split a vector into two vectors where the length of the two is determined by the context.

>>> splitAtI (1:>2:>3:>7:>8:>Nil) :: (Vec 2 Int, Vec 3 Int)
(1 :> 2 :> Nil,3 :> 7 :> 8 :> Nil)

concat :: Vec n (Vec m a) -> Vec (n * m) a Source #

Concatenate a vector of vectors.

>>> concat ((1:>2:>3:>Nil) :> (4:>5:>6:>Nil) :> (7:>8:>9:>Nil) :> (10:>11:>12:>Nil) :> Nil)
1 :> 2 :> 3 :> 4 :> 5 :> 6 :> 7 :> 8 :> 9 :> 10 :> 11 :> 12 :> Nil

concatMap :: (a -> Vec m b) -> Vec n a -> Vec (n * m) b Source #

Map a function over all the elements of a vector and concatentate the resulting vectors.

>>> concatMap (replicate d3) (1:>2:>3:>Nil)
1 :> 1 :> 1 :> 2 :> 2 :> 2 :> 3 :> 3 :> 3 :> Nil

unconcat :: KnownNat n => SNat m -> Vec (n * m) a -> Vec n (Vec m a) Source #

Split a vector of (n * m) elements into a vector of "vectors of length m", where the length m is given.

>>> unconcat d4 (1:>2:>3:>4:>5:>6:>7:>8:>9:>10:>11:>12:>Nil)
(1 :> 2 :> 3 :> 4 :> Nil) :> (5 :> 6 :> 7 :> 8 :> Nil) :> (9 :> 10 :> 11 :> 12 :> Nil) :> Nil

unconcatI :: (KnownNat n, KnownNat m) => Vec (n * m) a -> Vec n (Vec m a) Source #

Split a vector of (n * m) elements into a vector of "vectors of length m", where the length m is determined by the context.

>>> unconcatI (1:>2:>3:>4:>5:>6:>7:>8:>9:>10:>11:>12:>Nil) :: Vec 2 (Vec 6 Int)
(1 :> 2 :> 3 :> 4 :> 5 :> 6 :> Nil) :> (7 :> 8 :> 9 :> 10 :> 11 :> 12 :> Nil) :> Nil

merge :: KnownNat n => Vec n a -> Vec n a -> Vec (2 * n) a Source #

Merge two vectors, alternating their elements, i.e.,

>>> merge (1 :> 2 :> 3 :> 4 :> Nil) (5 :> 6 :> 7 :> 8 :> Nil)
1 :> 5 :> 2 :> 6 :> 3 :> 7 :> 4 :> 8 :> Nil

reverse :: Vec n a -> Vec n a Source #

The elements in a vector in reverse order.

>>> reverse (1:>2:>3:>4:>Nil)
4 :> 3 :> 2 :> 1 :> Nil

imap :: forall n a b. KnownNat n => (Index n -> a -> b) -> Vec n a -> Vec n b Source #

Apply a function of every element of a vector and its index.

>>> :t imap (+) (2 :> 2 :> 2 :> 2 :> Nil)
imap (+) (2 :> 2 :> 2 :> 2 :> Nil) :: Vec 4 (Index 4)
>>> imap (+) (2 :> 2 :> 2 :> 2 :> Nil)
2 :> 3 :> *** Exception: X: Clash.Sized.Index: result 4 is out of bounds: [0..3]
...
>>> imap (\i a -> extend (bitCoerce i) + a) (2 :> 2 :> 2 :> 2 :> Nil) :: Vec 4 (Unsigned 8)
2 :> 3 :> 4 :> 5 :> Nil

"imap f xs" corresponds to the following circuit layout:

izipWith :: KnownNat n => (Index n -> a -> b -> c) -> Vec n a -> Vec n b -> Vec n c Source #

Zip two vectors with a functions that also takes the elements' indices.

>>> izipWith (\i a b -> i + a + b) (2 :> 2 :> Nil)  (3 :> 3:> Nil)
*** Exception: X: Clash.Sized.Index: result 3 is out of bounds: [0..1]
...
>>> izipWith (\i a b -> extend (bitCoerce i) + a + b) (2 :> 2 :> Nil) (3 :> 3 :> Nil) :: Vec 2 (Unsigned 8)
5 :> 6 :> Nil

"imap f xs" corresponds to the following circuit layout:

NB: izipWith is strict in its second argument, and lazy in its third. This matters when izipWith is used in a recursive setting. See lazyV for more information.

ifoldr :: KnownNat n => (Index n -> a -> b -> b) -> b -> Vec n a -> b Source #

Right fold (function applied to each element and its index)

>>> let findLeftmost x xs = ifoldr (\i a b -> if a == x then Just i else b) Nothing xs
>>> findLeftmost 3 (1:>3:>2:>4:>3:>5:>6:>Nil)
Just 1
>>> findLeftmost 8 (1:>3:>2:>4:>3:>5:>6:>Nil)
Nothing

"ifoldr f z xs" corresponds to the following circuit layout:

ifoldl :: KnownNat n => (a -> Index n -> b -> a) -> a -> Vec n b -> a Source #

Left fold (function applied to each element and its index)

>>> let findRightmost x xs = ifoldl (\a i b -> if b == x then Just i else a) Nothing xs
>>> findRightmost 3 (1:>3:>2:>4:>3:>5:>6:>Nil)
Just 4
>>> findRightmost 8 (1:>3:>2:>4:>3:>5:>6:>Nil)
Nothing

"ifoldl f z xs" corresponds to the following circuit layout:

indices :: KnownNat n => SNat n -> Vec n (Index n) Source #

Generate a vector of indices.

>>> indices d4
0 :> 1 :> 2 :> 3 :> Nil

indicesI :: KnownNat n => Vec n (Index n) Source #

Generate a vector of indices, where the length of the vector is determined by the context.

>>> indicesI :: Vec 4 (Index 4)
0 :> 1 :> 2 :> 3 :> Nil

findIndex :: KnownNat n => (a -> Bool) -> Vec n a -> Maybe (Index n) Source #

"findIndex p xs" returns the index of the first element of xs satisfying the predicate p, or Nothing if there is no such element.

>>> findIndex (> 3) (1:>3:>2:>4:>3:>5:>6:>Nil)
Just 3
>>> findIndex (> 8) (1:>3:>2:>4:>3:>5:>6:>Nil)
Nothing

elemIndex :: (KnownNat n, Eq a) => a -> Vec n a -> Maybe (Index n) Source #

"elemIndex a xs" returns the index of the first element which is equal (by ==) to the query element a, or Nothing if there is no such element.

>>> elemIndex 3 (1:>3:>2:>4:>3:>5:>6:>Nil)
Just 1
>>> elemIndex 8 (1:>3:>2:>4:>3:>5:>6:>Nil)
Nothing

zipWith :: (a -> b -> c) -> Vec n a -> Vec n b -> Vec n c Source #

zipWith generalizes zip by zipping with the function given as the first argument, instead of a tupling function. For example, "zipWith (+)" applied to two vectors produces the vector of corresponding sums.

zipWith f (x1 :> x2 :> ... xn :> Nil) (y1 :> y2 :> ... :> yn :> Nil) == (f x1 y1 :> f x2 y2 :> ... :> f xn yn :> Nil)

"zipWith f xs ys" corresponds to the following circuit layout:

NB: zipWith is strict in its second argument, and lazy in its third. This matters when zipWith is used in a recursive setting. See lazyV for more information.

zipWith3 :: (a -> b -> c -> d) -> Vec n a -> Vec n b -> Vec n c -> Vec n d Source #

zipWith3 generalizes zip3 by zipping with the function given as the first argument, instead of a tupling function.

zipWith3 f (x1 :> x2 :> ... xn :> Nil) (y1 :> y2 :> ... :> yn :> Nil) (z1 :> z2 :> ... :> zn :> Nil) == (f x1 y1 z1 :> f x2 y2 z2 :> ... :> f xn yn zn :> Nil)

"zipWith3 f xs ys zs" corresponds to the following circuit layout:

NB: zipWith3 is strict in its second argument, and lazy in its third and fourth. This matters when zipWith3 is used in a recursive setting. See lazyV for more information.

zipWith4 :: (a -> b -> c -> d -> e) -> Vec n a -> Vec n b -> Vec n c -> Vec n d -> Vec n e Source #

zipWith5 :: (a -> b -> c -> d -> e -> f) -> Vec n a -> Vec n b -> Vec n c -> Vec n d -> Vec n e -> Vec n f Source #

zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> Vec n a -> Vec n b -> Vec n c -> Vec n d -> Vec n e -> Vec n f -> Vec n g Source #

zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> Vec n a -> Vec n b -> Vec n c -> Vec n d -> Vec n e -> Vec n f -> Vec n g -> Vec n h Source #

foldr1 :: (a -> a -> a) -> Vec (n + 1) a -> a Source #

foldr1 is a variant of foldr that has no starting value argument, and thus must be applied to non-empty vectors.

foldr1 f (x1 :> ... :> xn2 :> xn1 :> xn :> Nil) == x1 `f` (... (xn2 `f` (xn1 `f` xn))...)
foldr1 f (x1 :> Nil)                            == x1
foldr1 f Nil                                    == TYPE ERROR
>>> foldr1 (/) (5 :> 4 :> 3 :> 2 :> 1 :> Nil)
1.875

"foldr1 f xs" corresponds to the following circuit layout:

NB: "foldr1 f z xs" produces a linear structure, which has a depth, or delay, of O(length xs). Use fold if your binary operator f is associative, as "fold f xs" produces a structure with a depth of O(log_2(length xs)).

foldl1 :: (a -> a -> a) -> Vec (n + 1) a -> a Source #

foldl1 is a variant of foldl that has no starting value argument, and thus must be applied to non-empty vectors.

foldl1 f (x1 :> x2 :> x3 :> ... :> xn :> Nil) == (...((x1 `f` x2) `f` x3) `f`...) `f` xn
foldl1 f (x1 :> Nil)                          == x1
foldl1 f Nil                                  == TYPE ERROR
>>> foldl1 (/) (1 :> 5 :> 4 :> 3 :> 2 :> Nil)
8.333333333333333e-3

"foldl1 f xs" corresponds to the following circuit layout:

NB: "foldl1 f z xs" produces a linear structure, which has a depth, or delay, of O(length xs). Use fold if your binary operator f is associative, as "fold f xs" produces a structure with a depth of O(log_2(length xs)).

fold :: forall n a. (a -> a -> a) -> Vec (n + 1) a -> a Source #

fold is a variant of foldr1 and foldl1, but instead of reducing from right to left, or left to right, it reduces a vector using a tree-like structure. The depth, or delay, of the structure produced by "fold f xs", is hence O(log_2(length xs)), and not O(length xs).

NB: The binary operator "f" in "fold f xs" must be associative.

fold f (x1 :> x2 :> ... :> xn1 :> xn :> Nil) == ((x1 `f` x2) `f` ...) `f` (... `f` (xn1 `f` xn))
fold f (x1 :> Nil)                           == x1
fold f Nil                                   == TYPE ERROR
>>> fold (+) (5 :> 4 :> 3 :> 2 :> 1 :> Nil)
15

"fold f xs" corresponds to the following circuit layout:

scanl :: (b -> a -> b) -> b -> Vec n a -> Vec (n + 1) b Source #

scanl is similar to foldl, but returns a vector of successive reduced values from the left:

scanl f z (x1 :> x2 :> ... :> Nil) == z :> (z `f` x1) :> ((z `f` x1) `f` x2) :> ... :> Nil
>>> scanl (+) 0 (5 :> 4 :> 3 :> 2 :> Nil)
0 :> 5 :> 9 :> 12 :> 14 :> Nil

"scanl f z xs" corresponds to the following circuit layout:

  • NB:

    last (scanl f z xs) == foldl f z xs
  • For a different trade-off between circuit size and logic depth for associative operators, see Clash.Sized.RTree

scanl1 :: KnownNat n => (a -> a -> a) -> Vec (n + 1) a -> Vec (n + 1) a Source #

scanl with no seed value

>>> scanl1 (-) (1 :> 2 :> 3 :> 4 :> Nil)
1 :> -1 :> -4 :> -8 :> Nil

scanr1 :: KnownNat n => (a -> a -> a) -> Vec (n + 1) a -> Vec (n + 1) a Source #

scanr with no seed value

>>> scanr1 (-) (1 :> 2 :> 3 :> 4 :> Nil)
-2 :> 3 :> -1 :> 4 :> Nil

postscanl :: (b -> a -> b) -> b -> Vec n a -> Vec n b Source #

postscanl is a variant of scanl where the first result is dropped:

postscanl f z (x1 :> x2 :> ... :> Nil) == (z `f` x1) :> ((z `f` x1) `f` x2) :> ... :> Nil
>>> postscanl (+) 0 (5 :> 4 :> 3 :> 2 :> Nil)
5 :> 9 :> 12 :> 14 :> Nil

"postscanl f z xs" corresponds to the following circuit layout:

scanr :: (a -> b -> b) -> b -> Vec n a -> Vec (n + 1) b Source #

scanr is similar to foldr, but returns a vector of successive reduced values from the right:

scanr f z (... :> xn1 :> xn :> Nil) == ... :> (xn1 `f` (xn `f` z)) :> (xn `f` z) :> z :> Nil
>>> scanr (+) 0 (5 :> 4 :> 3 :> 2 :> Nil)
14 :> 9 :> 5 :> 2 :> 0 :> Nil

"scanr f z xs" corresponds to the following circuit layout:

  • NB:

    head (scanr f z xs) == foldr f z xs
  • For a different trade-off between circuit size and logic depth for associative operators, see Clash.Sized.RTree

postscanr :: (a -> b -> b) -> b -> Vec n a -> Vec n b Source #

postscanr is a variant of scanr that where the last result is dropped:

postscanr f z (... :> xn1 :> xn :> Nil) == ... :> (xn1 `f` (xn `f` z)) :> (xn `f` z) :> Nil
>>> postscanr (+) 0 (5 :> 4 :> 3 :> 2 :> Nil)
14 :> 9 :> 5 :> 2 :> Nil

"postscanr f z xs" corresponds to the following circuit layout:

mapAccumL :: (acc -> x -> (acc, y)) -> acc -> Vec n x -> (acc, Vec n y) Source #

The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a vector, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new vector.

>>> mapAccumL (\acc x -> (acc + x,acc + 1)) 0 (1 :> 2 :> 3 :> 4 :> Nil)
(10,1 :> 2 :> 4 :> 7 :> Nil)

"mapAccumL f acc xs" corresponds to the following circuit layout:

mapAccumR :: (acc -> x -> (acc, y)) -> acc -> Vec n x -> (acc, Vec n y) Source #

The mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a vector, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new vector.

>>> mapAccumR (\acc x -> (acc + x,acc + 1)) 0 (1 :> 2 :> 3 :> 4 :> Nil)
(10,10 :> 8 :> 5 :> 1 :> Nil)

"mapAccumR f acc xs" corresponds to the following circuit layout:

zip :: Vec n a -> Vec n b -> Vec n (a, b) Source #

zip takes two vectors and returns a vector of corresponding pairs.

>>> zip (1:>2:>3:>4:>Nil) (4:>3:>2:>1:>Nil)
(1,4) :> (2,3) :> (3,2) :> (4,1) :> Nil

zip3 :: Vec n a -> Vec n b -> Vec n c -> Vec n (a, b, c) Source #

zip3 takes three vectors and returns a vector of corresponding triplets.

>>> zip3 (1:>2:>3:>4:>Nil) (4:>3:>2:>1:>Nil) (5:>6:>7:>8:>Nil)
(1,4,5) :> (2,3,6) :> (3,2,7) :> (4,1,8) :> Nil

zip4 :: Vec n a -> Vec n b -> Vec n c -> Vec n d -> Vec n (a, b, c, d) Source #

zip4 takes four vectors and returns a list of quadruples, analogous to zip.

zip5 :: Vec n a -> Vec n b -> Vec n c -> Vec n d -> Vec n e -> Vec n (a, b, c, d, e) Source #

zip5 takes five vectors and returns a list of five-tuples, analogous to zip.

zip6 :: Vec n a -> Vec n b -> Vec n c -> Vec n d -> Vec n e -> Vec n f -> Vec n (a, b, c, d, e, f) Source #

zip6 takes six vectors and returns a list of six-tuples, analogous to zip.

zip7 :: Vec n a -> Vec n b -> Vec n c -> Vec n d -> Vec n e -> Vec n f -> Vec n g -> Vec n (a, b, c, d, e, f, g) Source #

zip7 takes seven vectors and returns a list of seven-tuples, analogous to zip.

unzip :: Vec n (a, b) -> (Vec n a, Vec n b) Source #

unzip transforms a vector of pairs into a vector of first components and a vector of second components.

>>> unzip ((1,4):>(2,3):>(3,2):>(4,1):>Nil)
(1 :> 2 :> 3 :> 4 :> Nil,4 :> 3 :> 2 :> 1 :> Nil)

unzip3 :: Vec n (a, b, c) -> (Vec n a, Vec n b, Vec n c) Source #

unzip3 transforms a vector of triplets into a vector of first components, a vector of second components, and a vector of third components.

>>> unzip3 ((1,4,5):>(2,3,6):>(3,2,7):>(4,1,8):>Nil)
(1 :> 2 :> 3 :> 4 :> Nil,4 :> 3 :> 2 :> 1 :> Nil,5 :> 6 :> 7 :> 8 :> Nil)

unzip4 :: Vec n (a, b, c, d) -> (Vec n a, Vec n b, Vec n c, Vec n d) Source #

unzip4 takes a vector of quadruples and returns four vectors, analogous to unzip.

unzip5 :: Vec n (a, b, c, d, e) -> (Vec n a, Vec n b, Vec n c, Vec n d, Vec n e) Source #

unzip5 takes a vector of five-tuples and returns five vectors, analogous to unzip.

unzip6 :: Vec n (a, b, c, d, e, f) -> (Vec n a, Vec n b, Vec n c, Vec n d, Vec n e, Vec n f) Source #

unzip6 takes a vector of six-tuples and returns six vectors, analogous to unzip.

unzip7 :: Vec n (a, b, c, d, e, f, g) -> (Vec n a, Vec n b, Vec n c, Vec n d, Vec n e, Vec n f, Vec n g) Source #

unzip7 takes a vector of seven-tuples and returns seven vectors, analogous to unzip.

(!!) :: (KnownNat n, Enum i) => Vec n a -> i -> a Source #

"xs !! n" returns the n'th element of xs.

NB: Vector elements have an ASCENDING subscript starting from 0 and ending at length - 1.

>>> (1:>2:>3:>4:>5:>Nil) !! 4
5
>>> (1:>2:>3:>4:>5:>Nil) !! (length (1:>2:>3:>4:>5:>Nil) - 1)
5
>>> (1:>2:>3:>4:>5:>Nil) !! 1
2
>>> (1:>2:>3:>4:>5:>Nil) !! 14
*** Exception: Clash.Sized.Vector.(!!): index 14 is larger than maximum index 4
...

length :: KnownNat n => Vec n a -> Int Source #

The length of a Vector as an Int value.

>>> length (6 :> 7 :> 8 :> Nil)
3

replace :: (KnownNat n, Enum i) => i -> a -> Vec n a -> Vec n a Source #

"replace n a xs" returns the vector xs where the n'th element is replaced by a.

NB: Vector elements have an ASCENDING subscript starting from 0 and ending at length - 1.

>>> replace 3 7 (1:>2:>3:>4:>5:>Nil)
1 :> 2 :> 3 :> 7 :> 5 :> Nil
>>> replace 0 7 (1:>2:>3:>4:>5:>Nil)
7 :> 2 :> 3 :> 4 :> 5 :> Nil
>>> replace 9 7 (1:>2:>3:>4:>5:>Nil)
1 :> 2 :> 3 :> 4 :> 5 :> *** Exception: Clash.Sized.Vector.replace: index 9 is larger than maximum index 4
...

take :: SNat m -> Vec (m + n) a -> Vec m a Source #

"take n xs" returns the n-length prefix of xs.

>>> take (SNat :: SNat 3) (1:>2:>3:>4:>5:>Nil)
1 :> 2 :> 3 :> Nil
>>> take d3               (1:>2:>3:>4:>5:>Nil)
1 :> 2 :> 3 :> Nil
>>> take d0               (1:>2:>Nil)
Nil
>>> take d4               (1:>2:>Nil)

<interactive>:...
    • Couldn't match type ‘4 + n0’ with ‘2’
      Expected type: Vec (4 + n0) a
        Actual type: Vec (1 + 1) a
      The type variable ‘n0’ is ambiguous
    • In the second argument of ‘take’, namely ‘(1 :> 2 :> Nil)’
      In the expression: take d4 (1 :> 2 :> Nil)
      In an equation for ‘it’: it = take d4 (1 :> 2 :> Nil)

takeI :: KnownNat m => Vec (m + n) a -> Vec m a Source #

"takeI xs" returns the prefix of xs as demanded by the context.

>>> takeI (1:>2:>3:>4:>5:>Nil) :: Vec 2 Int
1 :> 2 :> Nil

drop :: SNat m -> Vec (m + n) a -> Vec n a Source #

"drop n xs" returns the suffix of xs after the first n elements.

>>> drop (SNat :: SNat 3) (1:>2:>3:>4:>5:>Nil)
4 :> 5 :> Nil
>>> drop d3               (1:>2:>3:>4:>5:>Nil)
4 :> 5 :> Nil
>>> drop d0               (1:>2:>Nil)
1 :> 2 :> Nil
>>> drop d4               (1:>2:>Nil)

<interactive>:...: error:...
    • Couldn't match...type ‘4 + n0...
      The type variable ‘n0’ is ambiguous
    • In the first argument of ‘print’, namely ‘it’
      In a stmt of an interactive GHCi command: print it

dropI :: KnownNat m => Vec (m + n) a -> Vec n a Source #

"dropI xs" returns the suffix of xs as demanded by the context.

>>> dropI (1:>2:>3:>4:>5:>Nil) :: Vec 2 Int
4 :> 5 :> Nil

at :: SNat m -> Vec (m + (n + 1)) a -> a Source #

"at n xs" returns n'th element of xs

NB: Vector elements have an ASCENDING subscript starting from 0 and ending at length - 1.

>>> at (SNat :: SNat 1) (1:>2:>3:>4:>5:>Nil)
2
>>> at d1               (1:>2:>3:>4:>5:>Nil)
2

select :: CmpNat (i + s) (s * n) ~ 'GT => SNat f -> SNat s -> SNat n -> Vec (f + i) a -> Vec n a Source #

"select f s n xs" selects n elements with step-size s and offset f from xs.

>>> select (SNat :: SNat 1) (SNat :: SNat 2) (SNat :: SNat 3) (1:>2:>3:>4:>5:>6:>7:>8:>Nil)
2 :> 4 :> 6 :> Nil
>>> select d1 d2 d3 (1:>2:>3:>4:>5:>6:>7:>8:>Nil)
2 :> 4 :> 6 :> Nil

selectI :: (CmpNat (i + s) (s * n) ~ 'GT, KnownNat n) => SNat f -> SNat s -> Vec (f + i) a -> Vec n a Source #

"selectI f s xs" selects as many elements as demanded by the context with step-size s and offset f from xs.

>>> selectI d1 d2 (1:>2:>3:>4:>5:>6:>7:>8:>Nil) :: Vec 2 Int
2 :> 4 :> Nil

replicate :: SNat n -> a -> Vec n a Source #

"replicate n a" returns a vector that has n copies of a.

>>> replicate (SNat :: SNat 3) 6
6 :> 6 :> 6 :> Nil
>>> replicate d3 6
6 :> 6 :> 6 :> Nil

repeat :: KnownNat n => a -> Vec n a Source #

"repeat a" creates a vector with as many copies of a as demanded by the context.

>>> repeat 6 :: Vec 5 Int
6 :> 6 :> 6 :> 6 :> 6 :> Nil

iterate :: SNat n -> (a -> a) -> a -> Vec n a Source #

"iterate n f x" returns a vector starting with x followed by n repeated applications of f to x.

iterate (SNat :: SNat 4) f x == (x :> f x :> f (f x) :> f (f (f x)) :> Nil)
iterate d4 f x               == (x :> f x :> f (f x) :> f (f (f x)) :> Nil)
>>> iterate d4 (+1) 1
1 :> 2 :> 3 :> 4 :> Nil

"iterate n f z" corresponds to the following circuit layout:

iterateI :: forall n a. KnownNat n => (a -> a) -> a -> Vec n a Source #

"iterateI f x" returns a vector starting with x followed by n repeated applications of f to x, where n is determined by the context.

iterateI f x :: Vec 3 a == (x :> f x :> f (f x) :> Nil)
>>> iterateI (+1) 1 :: Vec 3 Int
1 :> 2 :> 3 :> Nil

"iterateI f z" corresponds to the following circuit layout:

unfoldr :: SNat n -> (s -> (a, s)) -> s -> Vec n a Source #

"unfoldr n f s" builds a vector of length n from a seed value s, where every element a is created by successive calls of f on s. Unlike unfoldr from Data.List the generating function f cannot dictate the length of the resulting vector, it must be statically known.

a simple use of unfoldr:

>>> unfoldr d10 (\s -> (s,s-1)) 10
10 :> 9 :> 8 :> 7 :> 6 :> 5 :> 4 :> 3 :> 2 :> 1 :> Nil

unfoldrI :: KnownNat n => (s -> (a, s)) -> s -> Vec n a Source #

"unfoldrI f s" builds a vector from a seed value s, where every element a is created by successive calls of f on s; the length of the vector is inferred from the context. Unlike unfoldr from Data.List the generating function f cannot dictate the length of the resulting vector, it must be statically known.

a simple use of unfoldrI:

>>> unfoldrI (\s -> (s,s-1)) 10 :: Vec 10 Int
10 :> 9 :> 8 :> 7 :> 6 :> 5 :> 4 :> 3 :> 2 :> 1 :> Nil

generate :: SNat n -> (a -> a) -> a -> Vec n a Source #

"generate n f x" returns a vector with n repeated applications of f to x.

generate (SNat :: SNat 4) f x == (f x :> f (f x) :> f (f (f x)) :> f (f (f (f x))) :> Nil)
generate d4 f x               == (f x :> f (f x) :> f (f (f x)) :> f (f (f (f x))) :> Nil)
>>> generate d4 (+1) 1
2 :> 3 :> 4 :> 5 :> Nil

"generate n f z" corresponds to the following circuit layout:

generateI :: KnownNat n => (a -> a) -> a -> Vec n a Source #

"generateI f x" returns a vector with n repeated applications of f to x, where n is determined by the context.

generateI f x :: Vec 3 a == (f x :> f (f x) :> f (f (f x)) :> Nil)
>>> generateI (+1) 1 :: Vec 3 Int
2 :> 3 :> 4 :> Nil

"generateI f z" corresponds to the following circuit layout:

transpose :: KnownNat n => Vec m (Vec n a) -> Vec n (Vec m a) Source #

Transpose a matrix: go from row-major to column-major

>>> let xss = (1:>2:>Nil):>(3:>4:>Nil):>(5:>6:>Nil):>Nil
>>> xss
(1 :> 2 :> Nil) :> (3 :> 4 :> Nil) :> (5 :> 6 :> Nil) :> Nil
>>> transpose xss
(1 :> 3 :> 5 :> Nil) :> (2 :> 4 :> 6 :> Nil) :> Nil

stencil1d Source #

Arguments

:: KnownNat n 
=> SNat (stX + 1)

Windows length stX, at least size 1

-> (Vec (stX + 1) a -> b)

The stencil (function)

-> Vec ((stX + n) + 1) a 
-> Vec (n + 1) b 

1-dimensional stencil computations

"stencil1d stX f xs", where xs has stX + n elements, applies the stencil computation f on: n + 1 overlapping (1D) windows of length stX, drawn from xs. The resulting vector has n + 1 elements.

>>> let xs = (1:>2:>3:>4:>5:>6:>Nil)
>>> :t xs
xs :: Num a => Vec 6 a
>>> :t stencil1d d2 sum xs
stencil1d d2 sum xs :: Num b => Vec 5 b
>>> stencil1d d2 sum xs
3 :> 5 :> 7 :> 9 :> 11 :> Nil

stencil2d Source #

Arguments

:: (KnownNat n, KnownNat m) 
=> SNat (stY + 1)

Window hight stY, at least size 1

-> SNat (stX + 1)

Window width stX, at least size 1

-> (Vec (stY + 1) (Vec (stX + 1) a) -> b)

The stencil (function)

-> Vec ((stY + m) + 1) (Vec ((stX + n) + 1) a) 
-> Vec (m + 1) (Vec (n + 1) b) 

2-dimensional stencil computations

"stencil2d stY stX f xss", where xss is a matrix of stY + m rows of stX + n elements, applies the stencil computation f on: (m + 1) * (n + 1) overlapping (2D) windows of stY rows of stX elements, drawn from xss. The result matrix has m + 1 rows of n + 1 elements.

>>> let xss = ((1:>2:>3:>4:>Nil):>(5:>6:>7:>8:>Nil):>(9:>10:>11:>12:>Nil):>(13:>14:>15:>16:>Nil):>Nil)
>>> :t xss
xss :: Num a => Vec 4 (Vec 4 a)
>>> :t stencil2d d2 d2 (sum . map sum) xss
stencil2d d2 d2 (sum . map sum) xss :: Num b => Vec 3 (Vec 3 b)
>>> stencil2d d2 d2 (sum . map sum) xss
(14 :> 18 :> 22 :> Nil) :> (30 :> 34 :> 38 :> Nil) :> (46 :> 50 :> 54 :> Nil) :> Nil

windows1d Source #

Arguments

:: KnownNat n 
=> SNat (stX + 1)

Length of the window, at least size 1

-> Vec ((stX + n) + 1) a 
-> Vec (n + 1) (Vec (stX + 1) a) 

"windows1d stX xs", where the vector xs has stX + n elements, returns a vector of n + 1 overlapping (1D) windows of xs of length stX.

>>> let xs = (1:>2:>3:>4:>5:>6:>Nil)
>>> :t xs
xs :: Num a => Vec 6 a
>>> :t windows1d d2 xs
windows1d d2 xs :: Num a => Vec 5 (Vec 2 a)
>>> windows1d d2 xs
(1 :> 2 :> Nil) :> (2 :> 3 :> Nil) :> (3 :> 4 :> Nil) :> (4 :> 5 :> Nil) :> (5 :> 6 :> Nil) :> Nil

windows2d Source #

Arguments

:: (KnownNat n, KnownNat m) 
=> SNat (stY + 1)

Window hight stY, at least size 1

-> SNat (stX + 1)

Window width stX, at least size 1

-> Vec ((stY + m) + 1) (Vec ((stX + n) + 1) a) 
-> Vec (m + 1) (Vec (n + 1) (Vec (stY + 1) (Vec (stX + 1) a))) 

"windows2d stY stX xss", where matrix xss has stY + m rows of stX + n, returns a matrix of m+1 rows of n+1 elements. The elements of this new matrix are the overlapping (2D) windows of xss, where every window has stY rows of stX elements.

>>> let xss = ((1:>2:>3:>4:>Nil):>(5:>6:>7:>8:>Nil):>(9:>10:>11:>12:>Nil):>(13:>14:>15:>16:>Nil):>Nil)
>>> :t xss
xss :: Num a => Vec 4 (Vec 4 a)
>>> :t windows2d d2 d2 xss
windows2d d2 d2 xss :: Num a => Vec 3 (Vec 3 (Vec 2 (Vec 2 a)))
>>> windows2d d2 d2 xss
(((1 :> 2 :> Nil) :> (5 :> 6 :> Nil) :> Nil) :> ((2 :> 3 :> Nil) :> (6 :> 7 :> Nil) :> Nil) :> ((3 :> 4 :> Nil) :> (7 :> 8 :> Nil) :> Nil) :> Nil) :> (((5 :> 6 :> Nil) :> (9 :> 10 :> Nil) :> Nil) :> ((6 :> 7 :> Nil) :> (10 :> 11 :> Nil) :> Nil) :> ((7 :> 8 :> Nil) :> (11 :> 12 :> Nil) :> Nil) :> Nil) :> (((9 :> 10 :> Nil) :> (13 :> 14 :> Nil) :> Nil) :> ((10 :> 11 :> Nil) :> (14 :> 15 :> Nil) :> Nil) :> ((11 :> 12 :> Nil) :> (15 :> 16 :> Nil) :> Nil) :> Nil) :> Nil

permute Source #

Arguments

:: (Enum i, KnownNat n, KnownNat m) 
=> (a -> a -> a)

Combination function, f

-> Vec n a

Default values, def

-> Vec m i

Index mapping, is

-> Vec (m + k) a

Vector to be permuted, xs

-> Vec n a 

Forward permutation specified by an index mapping, ix. The result vector is initialized by the given defaults, def, and an further values that are permuted into the result are added to the current value using the given combination function, f.

The combination function must be associative and commutative.

backpermute Source #

Arguments

:: (Enum i, KnownNat n) 
=> Vec n a

Source vector, xs

-> Vec m i

Index mapping, is

-> Vec m a 

Backwards permutation specified by an index mapping, is, from the destination vector specifying which element of the source vector xs to read.

"backpermute xs is" is equivalent to "map (xs !!) is".

For example:

>>> let input = 1:>9:>6:>4:>4:>2:>0:>1:>2:>Nil
>>> let from  = 1:>3:>7:>2:>5:>3:>Nil
>>> backpermute input from
9 :> 4 :> 1 :> 6 :> 2 :> 4 :> Nil

scatter Source #

Arguments

:: (Enum i, KnownNat n, KnownNat m) 
=> Vec n a

Default values, def

-> Vec m i

Index mapping, is

-> Vec (m + k) a

Vector to be scattered, xs

-> Vec n a 

Copy elements from the source vector, xs, to the destination vector according to an index mapping is. This is a forward permute operation where a to vector encodes an input to output index mapping. Output elements for indices that are not mapped assume the value in the default vector def.

For example:

>>> let defVec = 0:>0:>0:>0:>0:>0:>0:>0:>0:>Nil
>>> let to = 1:>3:>7:>2:>5:>8:>Nil
>>> let input = 1:>9:>6:>4:>4:>2:>5:>Nil
>>> scatter defVec to input
0 :> 1 :> 4 :> 9 :> 0 :> 4 :> 0 :> 6 :> 2 :> Nil

NB: If the same index appears in the index mapping more than once, the latest mapping is chosen.

gather Source #

Arguments

:: (Enum i, KnownNat n) 
=> Vec n a

Source vector, xs

-> Vec m i

Index mapping, is

-> Vec m a 

Backwards permutation specified by an index mapping, is, from the destination vector specifying which element of the source vector xs to read.

"gather xs is" is equivalent to "map (xs !!) is".

For example:

>>> let input = 1:>9:>6:>4:>4:>2:>0:>1:>2:>Nil
>>> let from  = 1:>3:>7:>2:>5:>3:>Nil
>>> gather input from
9 :> 4 :> 1 :> 6 :> 2 :> 4 :> Nil

interleave Source #

Arguments

:: (KnownNat n, KnownNat d) 
=> SNat d

Interleave step, d

-> Vec (n * d) a 
-> Vec (d * n) a 

"interleave d xs" creates a vector:

<x_0,x_d,x_(2d),...,x_1,x_(d+1),x_(2d+1),...,x_(d-1),x_(2d-1),x_(3d-1)>
>>> let xs = 1 :> 2 :> 3 :> 4 :> 5 :> 6 :> 7 :> 8 :> 9 :> Nil
>>> interleave d3 xs
1 :> 4 :> 7 :> 2 :> 5 :> 8 :> 3 :> 6 :> 9 :> Nil

rotateLeft :: (Enum i, KnownNat n) => Vec n a -> i -> Vec n a Source #

Dynamically rotate a Vector to the left:

>>> let xs = 1 :> 2 :> 3 :> 4 :> Nil
>>> rotateLeft xs 1
2 :> 3 :> 4 :> 1 :> Nil
>>> rotateLeft xs 2
3 :> 4 :> 1 :> 2 :> Nil
>>> rotateLeft xs (-1)
4 :> 1 :> 2 :> 3 :> Nil

NB: Use rotateLeftS if you want to rotate left by a static amount.

rotateRight :: (Enum i, KnownNat n) => Vec n a -> i -> Vec n a Source #

Dynamically rotate a Vector to the right:

>>> let xs = 1 :> 2 :> 3 :> 4 :> Nil
>>> rotateRight xs 1
4 :> 1 :> 2 :> 3 :> Nil
>>> rotateRight xs 2
3 :> 4 :> 1 :> 2 :> Nil
>>> rotateRight xs (-1)
2 :> 3 :> 4 :> 1 :> Nil

NB: Use rotateRightS if you want to rotate right by a static amount.

rotateLeftS :: KnownNat n => Vec n a -> SNat d -> Vec n a Source #

Statically rotate a Vector to the left:

>>> let xs = 1 :> 2 :> 3 :> 4 :> Nil
>>> rotateLeftS xs d1
2 :> 3 :> 4 :> 1 :> Nil

NB: Use rotateLeft if you want to rotate left by a dynamic amount.

rotateRightS :: KnownNat n => Vec n a -> SNat d -> Vec n a Source #

Statically rotate a Vector to the right:

>>> let xs = 1 :> 2 :> 3 :> 4 :> Nil
>>> rotateRightS xs d1
4 :> 1 :> 2 :> 3 :> Nil

NB: Use rotateRight if you want to rotate right by a dynamic amount.

toList :: Vec n a -> [a] Source #

Convert a vector to a list.

>>> toList (1:>2:>3:>Nil)
[1,2,3]

NB: This function is not synthesizable

listToVecTH :: Lift a => [a] -> ExpQ Source #

Create a vector literal from a list literal.

$(listToVecTH [1::Signed 8,2,3,4,5]) == (8:>2:>3:>4:>5:>Nil) :: Vec 5 (Signed 8)
>>> [1 :: Signed 8,2,3,4,5]
[1,2,3,4,5]
>>> $(listToVecTH [1::Signed 8,2,3,4,5])
1 :> 2 :> 3 :> 4 :> 5 :> Nil

asNatProxy :: Vec n a -> Proxy n Source #

Vector as a Proxy for Nat

lengthS :: KnownNat n => Vec n a -> SNat n Source #

Length of a Vector as an SNat value

lazyV :: KnownNat n => Vec n a -> Vec n a Source #

What you should use when your vector functions are too strict in their arguments.

doctests setup

Expand
>>> let compareSwapL a b = if a < b then (a,b) else (b,a)
>>> :{
let sortVL :: (Ord a, KnownNat (n + 1)) => Vec ((n + 1) + 1) a -> Vec ((n + 1) + 1) a
    sortVL xs = map fst sorted :< (snd (last sorted))
      where
        lefts  = head xs :> map snd (init sorted)
        rights = tail xs
        sorted = zipWith compareSwapL (lazyV lefts) rights
:}
>>> :{
let sortV_flip xs = map fst sorted :< (snd (last sorted))
      where
        lefts  = head xs :> map snd (init sorted)
        rights = tail xs
        sorted = zipWith (flip compareSwapL) rights lefts
:}

Example usage

For example:

-- Bubble sort for 1 iteration
sortV xs = map fst sorted :< (snd (last sorted))
 where
   lefts  = head xs :> map snd (init sorted)
   rights = tail xs
   sorted = zipWith compareSwapL lefts rights

-- Compare and swap
compareSwapL a b = if a < b then (a,b)
                            else (b,a)

Will not terminate because zipWith is too strict in its second argument.

In this case, adding lazyV on zipWiths second argument:

sortVL xs = map fst sorted :< (snd (last sorted))
 where
   lefts  = head xs :> map snd (init sorted)
   rights = tail xs
   sorted = zipWith compareSwapL (lazyV lefts) rights

Results in a successful computation:

>>> sortVL (4 :> 1 :> 2 :> 3 :> Nil)
1 :> 2 :> 3 :> 4 :> Nil

NB: There is also a solution using flip, but it slightly obfuscates the meaning of the code:

sortV_flip xs = map fst sorted :< (snd (last sorted))
 where
   lefts  = head xs :> map snd (init sorted)
   rights = tail xs
   sorted = zipWith (flip compareSwapL) rights lefts
>>> sortV_flip (4 :> 1 :> 2 :> 3 :> Nil)
1 :> 2 :> 3 :> 4 :> Nil

dfold Source #

Arguments

:: forall p k a. KnownNat k 
=> Proxy (p :: TyFun Nat Type -> Type)

The motive

-> (forall l. SNat l -> a -> (p @@ l) -> p @@ (l + 1))

Function to fold.

NB: The SNat l is not the index (see (!!)) to the element a. SNat l is the number of elements that occur to the right of a.

-> (p @@ 0)

Initial element

-> Vec k a

Vector to fold over

-> p @@ k 

A dependently typed fold.

doctests setup

Expand
>>> :seti -fplugin GHC.TypeLits.Normalise
>>> import Data.Singletons (Apply, Proxy (..), TyFun)
>>> data Append (m :: Nat) (a :: Type) (f :: TyFun Nat Type) :: Type
>>> type instance Apply (Append m a) l = Vec (l + m) a
>>> let append' xs ys = dfold (Proxy :: Proxy (Append m a)) (const (:>)) ys xs

Example usage

Using lists, we can define append (a.k.a. Data.List.++) in terms of Data.List.foldr:

>>> import qualified Data.List
>>> let append xs ys = Data.List.foldr (:) ys xs
>>> append [1,2] [3,4]
[1,2,3,4]

However, when we try to do the same for Vec, by defining append' in terms of Clash.Sized.Vector.foldr:

append' xs ys = foldr (:>) ys xs

we get a type error:

>>> let append' xs ys = foldr (:>) ys xs

<interactive>:...
    • Occurs check: cannot construct the infinite type: ... ~ ... + 1
      Expected type: a -> Vec ... a -> Vec ... a
        Actual type: a -> Vec ... a -> Vec (... + 1) a
    • In the first argument of ‘foldr’, namely ‘(:>)’
      In the expression: foldr (:>) ys xs
      In an equation for ‘append'’: append' xs ys = foldr (:>) ys xs
    • Relevant bindings include
        ys :: Vec ... a (bound at ...)
        append' :: Vec n a -> Vec ... a -> Vec ... a
          (bound at ...)

The reason is that the type of foldr is:

>>> :t foldr
foldr :: (a -> b -> b) -> b -> Vec n a -> b

While the type of (:>) is:

>>> :t (:>)
(:>) :: a -> Vec n a -> Vec (n + 1) a

We thus need a fold function that can handle the growing vector type: dfold. Compared to foldr, dfold takes an extra parameter, called the motive, that allows the folded function to have an argument and result type that depends on the current length of the vector. Using dfold, we can now correctly define append':

import Data.Singletons
import Data.Proxy

data Append (m :: Nat) (a :: Type) (f :: TyFun Nat Type) :: Type
type instance Apply (Append m a) l = Vec (l + m) a

append' xs ys = dfold (Proxy :: Proxy (Append m a)) (const (:>)) ys xs

We now see that append' has the appropriate type:

>>> :t append'
append' :: KnownNat k => Vec k a -> Vec m a -> Vec (k + m) a

And that it works:

>>> append' (1 :> 2 :> Nil) (3 :> 4 :> Nil)
1 :> 2 :> 3 :> 4 :> Nil

NB: "dfold m f z xs" creates a linear structure, which has a depth, or delay, of O(length xs). Look at dtfold for a dependently typed fold that produces a structure with a depth of O(log_2(length xs)).

dtfold Source #

Arguments

:: forall p k a. KnownNat k 
=> Proxy (p :: TyFun Nat Type -> Type)

The motive

-> (a -> p @@ 0)

Function to apply to every element

-> (forall l. SNat l -> (p @@ l) -> (p @@ l) -> p @@ (l + 1))

Function to combine results.

NB: The SNat l indicates the depth/height of the node in the tree that is created by applying this function. The leafs of the tree have depth/height 0, and the root of the tree has height k.

-> Vec (2 ^ k) a

Vector to fold over.

NB: Must have a length that is a power of 2.

-> p @@ k 

A combination of dfold and fold: a dependently typed fold that reduces a vector in a tree-like structure.

doctests setup

Expand
>>> :seti -XUndecidableInstances
>>> import Data.Singletons (Apply, Proxy (..), TyFun)
>>> data IIndex (f :: TyFun Nat Type) :: Type
>>> type instance Apply IIndex l = Index ((2^l)+1)
>>> :{
let populationCount' :: (KnownNat k, KnownNat (2^k)) => BitVector (2^k) -> Index ((2^k)+1)
    populationCount' bv = dtfold (Proxy @IIndex)
                                 fromIntegral
                                 (\_ x y -> add x y)
                                 (bv2v bv)
:}

Example usage

As an example of when you might want to use dtfold we will build a population counter: a circuit that counts the number of bits set to '1' in a BitVector. Given a vector of n bits, we only need we need a data type that can represent the number n: Index (n+1). Index k has a range of [0 .. k-1] (using ceil(log2(k)) bits), hence we need Index n+1. As an initial attempt we will use sum, because it gives a nice (log2(n)) tree-structure of adders:

populationCount :: (KnownNat (n+1), KnownNat (n+2))
                => BitVector (n+1) -> Index (n+2)
populationCount = sum . map fromIntegral . bv2v

The "problem" with this description is that all adders have the same bit-width, i.e. all adders are of the type:

(+) :: Index (n+2) -> Index (n+2) -> Index (n+2).

This is a "problem" because we could have a more efficient structure: one where each layer of adders is precisely wide enough to count the number of bits at that layer. That is, at height d we want the adder to be of type:

Index ((2^d)+1) -> Index ((2^d)+1) -> Index ((2^(d+1))+1)

We have such an adder in the form of the add function, as defined in the instance ExtendingNum instance of Index. However, we cannot simply use fold to create a tree-structure of addes:

>>> :{
let populationCount' :: (KnownNat (n+1), KnownNat (n+2))
                     => BitVector (n+1) -> Index (n+2)
    populationCount' = fold add . map fromIntegral . bv2v
:}

<interactive>:...
    • Couldn't match type ‘((n + 2) + (n + 2)) - 1’ with ‘n + 2’
      Expected type: Index (n + 2) -> Index (n + 2) -> Index (n + 2)
        Actual type: Index (n + 2)
                     -> Index (n + 2) -> AResult (Index (n + 2)) (Index (n + 2))
    • In the first argument of ‘fold’, namely ‘add’
      In the first argument of ‘(.)’, namely ‘fold add’
      In the expression: fold add . map fromIntegral . bv2v
    • Relevant bindings include
        populationCount' :: BitVector (n + 1) -> Index (n + 2)
          (bound at ...)

because fold expects a function of type "a -> a -> a", i.e. a function where the arguments and result all have exactly the same type.

In order to accommodate the type of our add, where the result is larger than the arguments, we must use a dependently typed fold in the form of dtfold:

{-# LANGUAGE UndecidableInstances #-}
import Data.Singletons
import Data.Proxy

data IIndex (f :: TyFun Nat Type) :: Type
type instance Apply IIndex l = Index ((2^l)+1)

populationCount' :: (KnownNat k, KnownNat (2^k))
                 => BitVector (2^k) -> Index ((2^k)+1)
populationCount' bv = dtfold (Proxy @IIndex)
                             fromIntegral
                             (\_ x y -> add x y)
                             (bv2v bv)

And we can test that it works:

>>> :t populationCount' (7 :: BitVector 16)
populationCount' (7 :: BitVector 16) :: Index 17
>>> populationCount' (7 :: BitVector 16)
3

Some final remarks:

  • By using dtfold instead of fold, we had to restrict our BitVector argument to have bit-width that is a power of 2.
  • Even though our original populationCount function specified a structure where all adders had the same width. Most VHDL/(System)Verilog synthesis tools will create a more efficient circuit, i.e. one where the adders have an increasing bit-width for every layer, from the VHDL/(System)Verilog produced by the Clash compiler.

NB: The depth, or delay, of the structure produced by "dtfold m f g xs" is O(log_2(length xs)).

vfold :: forall k a b. KnownNat k => (forall l. SNat l -> a -> Vec l b -> Vec (l + 1) b) -> Vec k a -> Vec k b Source #

Specialised version of dfold that builds a triangular computational structure.

doctests setup

Expand
>>> let compareSwap a b = if a > b then (a,b) else (b,a)
>>> let insert y xs = let (y',xs') = mapAccumL compareSwap y xs in xs' :< y'
>>> let insertionSort = vfold (const insert)

Example usage

compareSwap a b = if a > b then (a,b) else (b,a)
insert y xs     = let (y',xs') = mapAccumL compareSwap y xs in xs' :< y'
insertionSort   = vfold (const insert)

Builds a triangular structure of compare and swaps to sort a row.

>>> insertionSort (7 :> 3 :> 9 :> 1 :> Nil)
1 :> 3 :> 7 :> 9 :> Nil

The circuit layout of insertionSort, build using vfold, is:

maximum :: Ord a => Vec (n + 1) a -> a Source #

The largest element of a non-empty vector

minimum :: Ord a => Vec (n + 1) a -> a Source #

The least element of a non-empty vector

smap :: forall k a b. KnownNat k => (forall l. SNat l -> a -> b) -> Vec k a -> Vec k b Source #

Apply a function to every element of a vector and the element's position (as an SNat value) in the vector.

>>> let rotateMatrix = smap (flip rotateRightS)
>>> let xss = (1:>2:>3:>Nil):>(1:>2:>3:>Nil):>(1:>2:>3:>Nil):>Nil
>>> xss
(1 :> 2 :> 3 :> Nil) :> (1 :> 2 :> 3 :> Nil) :> (1 :> 2 :> 3 :> Nil) :> Nil
>>> rotateMatrix xss
(1 :> 2 :> 3 :> Nil) :> (3 :> 1 :> 2 :> Nil) :> (2 :> 3 :> 1 :> Nil) :> Nil

concatBitVector# :: forall n m. (KnownNat n, KnownNat m) => Vec n (BitVector m) -> BitVector (n * m) Source #

unconcatBitVector# :: forall n m. (KnownNat n, KnownNat m) => BitVector (n * m) -> Vec n (BitVector m) Source #

v2bv :: KnownNat n => Vec n Bit -> BitVector n Source #

Convert a Vec of Bits to a BitVector.

>>> let x = (0:>0:>0:>1:>0:>0:>1:>0:>Nil) :: Vec 8 Bit
>>> x
0 :> 0 :> 0 :> 1 :> 0 :> 0 :> 1 :> 0 :> Nil
>>> v2bv x
0b0001_0010

seqV :: KnownNat n => Vec n a -> b -> b infixr 0 Source #

Evaluate all elements of a vector to WHNF, returning the second argument

forceV :: KnownNat n => Vec n a -> Vec n a Source #

Evaluate all elements of a vector to WHNF

seqVX :: KnownNat n => Vec n a -> b -> b infixr 0 Source #

Evaluate all elements of a vector to WHNF, returning the second argument. Does not propagate XExceptions.

forceVX :: KnownNat n => Vec n a -> Vec n a Source #

Evaluate all elements of a vector to WHNF. Does not propagate XExceptions.

Perfect depth trees

Annotations

Generics type-classes

class Generic a Source #

Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.

A Generic instance must satisfy the following laws:

from . toid
to . fromid

Minimal complete definition

from, to

Instances

Instances details
Generic Bool

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep Bool :: Type -> Type Source #

Methods

from :: Bool -> Rep Bool x Source #

to :: Rep Bool x -> Bool Source #

Generic Ordering

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep Ordering :: Type -> Type Source #

Generic Exp 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Exp :: Type -> Type Source #

Methods

from :: Exp -> Rep Exp x Source #

to :: Rep Exp x -> Exp Source #

Generic Match 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Match :: Type -> Type Source #

Methods

from :: Match -> Rep Match x Source #

to :: Rep Match x -> Match Source #

Generic Clause 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Clause :: Type -> Type Source #

Generic Pat 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Pat :: Type -> Type Source #

Methods

from :: Pat -> Rep Pat x Source #

to :: Rep Pat x -> Pat Source #

Generic Type 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Type :: Type -> Type Source #

Methods

from :: Type -> Rep Type x Source #

to :: Rep Type x -> Type Source #

Generic Dec 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Dec :: Type -> Type Source #

Methods

from :: Dec -> Rep Dec x Source #

to :: Rep Dec x -> Dec Source #

Generic Name 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Name :: Type -> Type Source #

Methods

from :: Name -> Rep Name x Source #

to :: Rep Name x -> Name Source #

Generic FunDep 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep FunDep :: Type -> Type Source #

Generic InjectivityAnn 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep InjectivityAnn :: Type -> Type Source #

Generic Overlap 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Overlap :: Type -> Type Source #

Generic ()

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep () :: Type -> Type Source #

Methods

from :: () -> Rep () x Source #

to :: Rep () x -> () Source #

Generic Version

Since: base-4.9.0.0

Instance details

Defined in Data.Version

Associated Types

type Rep Version :: Type -> Type Source #

Generic Void

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Associated Types

type Rep Void :: Type -> Type Source #

Methods

from :: Void -> Rep Void x Source #

to :: Rep Void x -> Void Source #

Generic ExitCode 
Instance details

Defined in GHC.IO.Exception

Associated Types

type Rep ExitCode :: Type -> Type Source #

Generic All

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep All :: Type -> Type Source #

Methods

from :: All -> Rep All x Source #

to :: Rep All x -> All Source #

Generic Any

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep Any :: Type -> Type Source #

Methods

from :: Any -> Rep Any x Source #

to :: Rep Any x -> Any Source #

Generic Fixity

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep Fixity :: Type -> Type Source #

Generic Associativity

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep Associativity :: Type -> Type Source #

Generic SourceUnpackedness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep SourceUnpackedness :: Type -> Type Source #

Generic SourceStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep SourceStrictness :: Type -> Type Source #

Generic DecidedStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep DecidedStrictness :: Type -> Type Source #

Generic Extension 
Instance details

Defined in GHC.LanguageExtensions.Type

Associated Types

type Rep Extension :: Type -> Type Source #

Generic ForeignSrcLang 
Instance details

Defined in GHC.ForeignSrcLang.Type

Associated Types

type Rep ForeignSrcLang :: Type -> Type Source #

Generic Half 
Instance details

Defined in Numeric.Half.Internal

Associated Types

type Rep Half :: Type -> Type Source #

Methods

from :: Half -> Rep Half x Source #

to :: Rep Half x -> Half Source #

Generic Boxed 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep Boxed :: Type -> Type Source #

Methods

from :: Boxed -> Rep Boxed x Source #

to :: Rep Boxed x -> Boxed Source #

Generic Tool 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep Tool :: Type -> Type Source #

Methods

from :: Tool -> Rep Tool x Source #

to :: Rep Tool x -> Tool Source #

Generic SrcLoc 
Instance details

Defined in Language.Haskell.Exts.SrcLoc

Associated Types

type Rep SrcLoc :: Type -> Type Source #

Generic SrcSpan 
Instance details

Defined in Language.Haskell.Exts.SrcLoc

Associated Types

type Rep SrcSpan :: Type -> Type Source #

Generic SrcSpanInfo 
Instance details

Defined in Language.Haskell.Exts.SrcLoc

Associated Types

type Rep SrcSpanInfo :: Type -> Type Source #

Generic Mode 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep Mode :: Type -> Type Source #

Methods

from :: Mode -> Rep Mode x Source #

to :: Rep Mode x -> Mode Source #

Generic Style 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep Style :: Type -> Type Source #

Methods

from :: Style -> Rep Style x Source #

to :: Rep Style x -> Style Source #

Generic Stmt 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Stmt :: Type -> Type Source #

Methods

from :: Stmt -> Rep Stmt x Source #

to :: Rep Stmt x -> Stmt Source #

Generic ModName 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep ModName :: Type -> Type Source #

Generic Phases 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Phases :: Type -> Type Source #

Generic RuleBndr 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep RuleBndr :: Type -> Type Source #

Generic Pragma 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Pragma :: Type -> Type Source #

Generic DerivClause 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep DerivClause :: Type -> Type Source #

Generic Con 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Con :: Type -> Type Source #

Methods

from :: Con -> Rep Con x Source #

to :: Rep Con x -> Con Source #

Generic DerivStrategy 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep DerivStrategy :: Type -> Type Source #

Generic TySynEqn 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TySynEqn :: Type -> Type Source #

Generic Fixity 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Fixity :: Type -> Type Source #

Generic TyVarBndr 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TyVarBndr :: Type -> Type Source #

Generic Doc 
Instance details

Defined in Text.PrettyPrint.HughesPJ

Associated Types

type Rep Doc :: Type -> Type Source #

Methods

from :: Doc -> Rep Doc x Source #

to :: Rep Doc x -> Doc Source #

Generic TextDetails 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep TextDetails :: Type -> Type Source #

Generic PkgName 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep PkgName :: Type -> Type Source #

Generic Module 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Module :: Type -> Type Source #

Generic OccName 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep OccName :: Type -> Type Source #

Generic NameFlavour 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep NameFlavour :: Type -> Type Source #

Generic NameSpace 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep NameSpace :: Type -> Type Source #

Generic Loc 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Loc :: Type -> Type Source #

Methods

from :: Loc -> Rep Loc x Source #

to :: Rep Loc x -> Loc Source #

Generic Info 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Info :: Type -> Type Source #

Methods

from :: Info -> Rep Info x Source #

to :: Rep Info x -> Info Source #

Generic ModuleInfo 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep ModuleInfo :: Type -> Type Source #

Generic FixityDirection 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep FixityDirection :: Type -> Type Source #

Generic Lit 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Lit :: Type -> Type Source #

Methods

from :: Lit -> Rep Lit x Source #

to :: Rep Lit x -> Lit Source #

Generic Bytes 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Bytes :: Type -> Type Source #

Methods

from :: Bytes -> Rep Bytes x Source #

to :: Rep Bytes x -> Bytes Source #

Generic Body 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Body :: Type -> Type Source #

Methods

from :: Body -> Rep Body x Source #

to :: Rep Body x -> Body Source #

Generic Guard 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Guard :: Type -> Type Source #

Methods

from :: Guard -> Rep Guard x Source #

to :: Rep Guard x -> Guard Source #

Generic Range 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Range :: Type -> Type Source #

Methods

from :: Range -> Rep Range x Source #

to :: Rep Range x -> Range Source #

Generic TypeFamilyHead 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TypeFamilyHead :: Type -> Type Source #

Generic Foreign 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Foreign :: Type -> Type Source #

Generic Callconv 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Callconv :: Type -> Type Source #

Generic Safety 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Safety :: Type -> Type Source #

Generic Inline 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Inline :: Type -> Type Source #

Generic RuleMatch 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep RuleMatch :: Type -> Type Source #

Generic AnnTarget 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep AnnTarget :: Type -> Type Source #

Generic SourceUnpackedness 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep SourceUnpackedness :: Type -> Type Source #

Generic SourceStrictness 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep SourceStrictness :: Type -> Type Source #

Generic DecidedStrictness 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep DecidedStrictness :: Type -> Type Source #

Generic Bang 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Bang :: Type -> Type Source #

Methods

from :: Bang -> Rep Bang x Source #

to :: Rep Bang x -> Bang Source #

Generic PatSynDir 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep PatSynDir :: Type -> Type Source #

Generic PatSynArgs 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep PatSynArgs :: Type -> Type Source #

Generic FamilyResultSig 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep FamilyResultSig :: Type -> Type Source #

Generic TyLit 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TyLit :: Type -> Type Source #

Methods

from :: TyLit -> Rep TyLit x Source #

to :: Rep TyLit x -> TyLit Source #

Generic Role 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Role :: Type -> Type Source #

Methods

from :: Role -> Rep Role x Source #

to :: Rep Role x -> Role Source #

Generic AnnLookup 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep AnnLookup :: Type -> Type Source #

Generic DatatypeInfo 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep DatatypeInfo :: Type -> Type Source #

Generic DatatypeVariant 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep DatatypeVariant :: Type -> Type Source #

Generic ConstructorInfo 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep ConstructorInfo :: Type -> Type Source #

Generic ConstructorVariant 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep ConstructorVariant :: Type -> Type Source #

Generic FieldStrictness 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep FieldStrictness :: Type -> Type Source #

Generic Unpackedness 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep Unpackedness :: Type -> Type Source #

Generic Strictness 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep Strictness :: Type -> Type Source #

Generic Specificity 
Instance details

Defined in Language.Haskell.TH.Datatype.TyVarBndr

Associated Types

type Rep Specificity :: Type -> Type Source #

Generic DTypeArg 
Instance details

Defined in Language.Haskell.TH.Desugar.Core

Associated Types

type Rep DTypeArg :: Type -> Type Source #

Generic DFunArgs 
Instance details

Defined in Language.Haskell.TH.Desugar.Core

Associated Types

type Rep DFunArgs :: Type -> Type Source #

Generic DVisFunArg 
Instance details

Defined in Language.Haskell.TH.Desugar.Core

Associated Types

type Rep DVisFunArg :: Type -> Type Source #

Generic DExp 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DExp :: Type -> Type Source #

Methods

from :: DExp -> Rep DExp x Source #

to :: Rep DExp x -> DExp Source #

Generic DPat 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DPat :: Type -> Type Source #

Methods

from :: DPat -> Rep DPat x Source #

to :: Rep DPat x -> DPat Source #

Generic DType 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DType :: Type -> Type Source #

Methods

from :: DType -> Rep DType x Source #

to :: Rep DType x -> DType Source #

Generic DTyVarBndr 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DTyVarBndr :: Type -> Type Source #

Generic DMatch 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DMatch :: Type -> Type Source #

Generic DClause 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DClause :: Type -> Type Source #

Generic DLetDec 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DLetDec :: Type -> Type Source #

Generic NewOrData 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep NewOrData :: Type -> Type Source #

Generic DDec 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DDec :: Type -> Type Source #

Methods

from :: DDec -> Rep DDec x Source #

to :: Rep DDec x -> DDec Source #

Generic DPatSynDir 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DPatSynDir :: Type -> Type Source #

Generic DTypeFamilyHead 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DTypeFamilyHead :: Type -> Type Source #

Generic DFamilyResultSig 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DFamilyResultSig :: Type -> Type Source #

Generic DCon 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DCon :: Type -> Type Source #

Methods

from :: DCon -> Rep DCon x Source #

to :: Rep DCon x -> DCon Source #

Generic DConFields 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DConFields :: Type -> Type Source #

Generic DForeign 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DForeign :: Type -> Type Source #

Generic DPragma 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DPragma :: Type -> Type Source #

Generic DRuleBndr 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DRuleBndr :: Type -> Type Source #

Generic DTySynEqn 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DTySynEqn :: Type -> Type Source #

Generic DInfo 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DInfo :: Type -> Type Source #

Methods

from :: DInfo -> Rep DInfo x Source #

to :: Rep DInfo x -> DInfo Source #

Generic DDerivClause 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DDerivClause :: Type -> Type Source #

Generic DDerivStrategy 
Instance details

Defined in Language.Haskell.TH.Desugar.AST

Associated Types

type Rep DDerivStrategy :: Type -> Type Source #

Generic ConstrRepr Source # 
Instance details

Defined in Clash.Annotations.BitRepresentation

Associated Types

type Rep ConstrRepr :: Type -> Type Source #

Generic DataReprAnn Source # 
Instance details

Defined in Clash.Annotations.BitRepresentation

Associated Types

type Rep DataReprAnn :: Type -> Type Source #

Generic ConstrRepr' Source # 
Instance details

Defined in Clash.Annotations.BitRepresentation.Internal

Associated Types

type Rep ConstrRepr' :: Type -> Type Source #

Generic DataRepr' Source # 
Instance details

Defined in Clash.Annotations.BitRepresentation.Internal

Associated Types

type Rep DataRepr' :: Type -> Type Source #

Generic Type' Source # 
Instance details

Defined in Clash.Annotations.BitRepresentation.Internal

Associated Types

type Rep Type' :: Type -> Type Source #

Methods

from :: Type' -> Rep Type' x Source #

to :: Rep Type' x -> Type' Source #

Generic PrimitiveWarning Source # 
Instance details

Defined in Clash.Annotations.Primitive

Associated Types

type Rep PrimitiveWarning :: Type -> Type Source #

Generic Primitive Source # 
Instance details

Defined in Clash.Annotations.Primitive

Associated Types

type Rep Primitive :: Type -> Type Source #

Generic HDL Source # 
Instance details

Defined in Clash.Annotations.Primitive

Associated Types

type Rep HDL :: Type -> Type Source #

Methods

from :: HDL -> Rep HDL x Source #

to :: Rep HDL x -> HDL Source #

Generic Bit Source # 
Instance details

Defined in Clash.Sized.Internal.BitVector

Associated Types

type Rep Bit :: Type -> Type Source #

Methods

from :: Bit -> Rep Bit x Source #

to :: Rep Bit x -> Bit Source #

Generic ClockAB Source # 
Instance details

Defined in Clash.Signal.Internal

Associated Types

type Rep ClockAB :: Type -> Type Source #

Generic Femtoseconds Source # 
Instance details

Defined in Clash.Signal.Internal

Associated Types

type Rep Femtoseconds :: Type -> Type Source #

Generic VDomainConfiguration Source # 
Instance details

Defined in Clash.Signal.Internal

Associated Types

type Rep VDomainConfiguration :: Type -> Type Source #

Generic InitBehavior Source # 
Instance details

Defined in Clash.Signal.Internal

Associated Types

type Rep InitBehavior :: Type -> Type Source #

Generic ResetPolarity Source # 
Instance details

Defined in Clash.Signal.Internal

Associated Types

type Rep ResetPolarity :: Type -> Type Source #

Generic ResetKind Source # 
Instance details

Defined in Clash.Signal.Internal

Associated Types

type Rep ResetKind :: Type -> Type Source #

Generic ActiveEdge Source # 
Instance details

Defined in Clash.Signal.Internal

Associated Types

type Rep ActiveEdge :: Type -> Type Source #

Generic PortName Source # 
Instance details

Defined in Clash.Annotations.TopEntity

Associated Types

type Rep PortName :: Type -> Type Source #

Generic TopEntity Source # 
Instance details

Defined in Clash.Annotations.TopEntity

Associated Types

type Rep TopEntity :: Type -> Type Source #

Generic RxReg Source # 
Instance details

Defined in Clash.Examples.Internal

Associated Types

type Rep RxReg :: Type -> Type Source #

Methods

from :: RxReg -> Rep RxReg x Source #

to :: Rep RxReg x -> RxReg Source #

Generic TxReg Source # 
Instance details

Defined in Clash.Examples.Internal

Associated Types

type Rep TxReg :: Type -> Type Source #

Methods

from :: TxReg -> Rep TxReg x Source #

to :: Rep TxReg x -> TxReg Source #

Generic [a]

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep [a] :: Type -> Type Source #

Methods

from :: [a] -> Rep [a] x Source #

to :: Rep [a] x -> [a] Source #

Generic (Maybe a)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Maybe a) :: Type -> Type Source #

Methods

from :: Maybe a -> Rep (Maybe a) x Source #

to :: Rep (Maybe a) x -> Maybe a Source #

Generic (Par1 p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Par1 p) :: Type -> Type Source #

Methods

from :: Par1 p -> Rep (Par1 p) x Source #

to :: Rep (Par1 p) x -> Par1 p Source #

Generic (Solo a) 
Instance details

Defined in Data.Tuple.Solo

Associated Types

type Rep (Solo a) :: Type -> Type Source #

Methods

from :: Solo a -> Rep (Solo a) x Source #

to :: Rep (Solo a) x -> Solo a Source #

Generic (Complex a)

Since: base-4.9.0.0

Instance details

Defined in Data.Complex

Associated Types

type Rep (Complex a) :: Type -> Type Source #

Methods

from :: Complex a -> Rep (Complex a) x Source #

to :: Rep (Complex a) x -> Complex a Source #

Generic (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Min a) :: Type -> Type Source #

Methods

from :: Min a -> Rep (Min a) x Source #

to :: Rep (Min a) x -> Min a Source #

Generic (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Max a) :: Type -> Type Source #

Methods

from :: Max a -> Rep (Max a) x Source #

to :: Rep (Max a) x -> Max a Source #

Generic (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (First a) :: Type -> Type Source #

Methods

from :: First a -> Rep (First a) x Source #

to :: Rep (First a) x -> First a Source #

Generic (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Last a) :: Type -> Type Source #

Methods

from :: Last a -> Rep (Last a) x Source #

to :: Rep (Last a) x -> Last a Source #

Generic (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (WrappedMonoid m) :: Type -> Type Source #

Generic (Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Option a) :: Type -> Type Source #

Methods

from :: Option a -> Rep (Option a) x Source #

to :: Rep (Option a) x -> Option a Source #

Generic (ZipList a)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep (ZipList a) :: Type -> Type Source #

Methods

from :: ZipList a -> Rep (ZipList a) x Source #

to :: Rep (ZipList a) x -> ZipList a Source #

Generic (Identity a)

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Associated Types

type Rep (Identity a) :: Type -> Type Source #

Methods

from :: Identity a -> Rep (Identity a) x Source #

to :: Rep (Identity a) x -> Identity a Source #

Generic (First a)

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep (First a) :: Type -> Type Source #

Methods

from :: First a -> Rep (First a) x Source #

to :: Rep (First a) x -> First a Source #

Generic (Last a)

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep (Last a) :: Type -> Type Source #

Methods

from :: Last a -> Rep (Last a) x Source #

to :: Rep (Last a) x -> Last a Source #

Generic (Dual a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Dual a) :: Type -> Type Source #

Methods

from :: Dual a -> Rep (Dual a) x Source #

to :: Rep (Dual a) x -> Dual a Source #

Generic (Endo a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Endo a) :: Type -> Type Source #

Methods

from :: Endo a -> Rep (Endo a) x Source #

to :: Rep (Endo a) x -> Endo a Source #

Generic (Sum a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Sum a) :: Type -> Type Source #

Methods

from :: Sum a -> Rep (Sum a) x Source #

to :: Rep (Sum a) x -> Sum a Source #

Generic (Product a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Product a) :: Type -> Type Source #

Methods

from :: Product a -> Rep (Product a) x Source #

to :: Rep (Product a) x -> Product a Source #

Generic (Down a)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Down a) :: Type -> Type Source #

Methods

from :: Down a -> Rep (Down a) x Source #

to :: Rep (Down a) x -> Down a Source #

Generic (NonEmpty a)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (NonEmpty a) :: Type -> Type Source #

Methods

from :: NonEmpty a -> Rep (NonEmpty a) x Source #

to :: Rep (NonEmpty a) x -> NonEmpty a Source #

Generic (Tree a)

Since: containers-0.5.8

Instance details

Defined in Data.Tree

Associated Types

type Rep (Tree a) :: Type -> Type Source #

Methods

from :: Tree a -> Rep (Tree a) x Source #

to :: Rep (Tree a) x -> Tree a Source #

Generic (FingerTree a)

Since: containers-0.6.1

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (FingerTree a) :: Type -> Type Source #

Methods

from :: FingerTree a -> Rep (FingerTree a) x Source #

to :: Rep (FingerTree a) x -> FingerTree a Source #

Generic (Digit a)

Since: containers-0.6.1

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (Digit a) :: Type -> Type Source #

Methods

from :: Digit a -> Rep (Digit a) x Source #

to :: Rep (Digit a) x -> Digit a Source #

Generic (Node a)

Since: containers-0.6.1

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (Node a) :: Type -> Type Source #

Methods

from :: Node a -> Rep (Node a) x Source #

to :: Rep (Node a) x -> Node a Source #

Generic (Elem a)

Since: containers-0.6.1

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (Elem a) :: Type -> Type Source #

Methods

from :: Elem a -> Rep (Elem a) x Source #

to :: Rep (Elem a) x -> Elem a Source #

Generic (ViewL a)

Since: containers-0.5.8

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (ViewL a) :: Type -> Type Source #

Methods

from :: ViewL a -> Rep (ViewL a) x Source #

to :: Rep (ViewL a) x -> ViewL a Source #

Generic (ViewR a)

Since: containers-0.5.8

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (ViewR a) :: Type -> Type Source #

Methods

from :: ViewR a -> Rep (ViewR a) x Source #

to :: Rep (ViewR a) x -> ViewR a Source #

Generic (Fix f) 
Instance details

Defined in Data.Fix

Associated Types

type Rep (Fix f) :: Type -> Type Source #

Methods

from :: Fix f -> Rep (Fix f) x Source #

to :: Rep (Fix f) x -> Fix f Source #

Generic (ModuleName l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ModuleName l) :: Type -> Type Source #

Methods

from :: ModuleName l -> Rep (ModuleName l) x Source #

to :: Rep (ModuleName l) x -> ModuleName l Source #

Generic (SpecialCon l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (SpecialCon l) :: Type -> Type Source #

Methods

from :: SpecialCon l -> Rep (SpecialCon l) x Source #

to :: Rep (SpecialCon l) x -> SpecialCon l Source #

Generic (QName l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (QName l) :: Type -> Type Source #

Methods

from :: QName l -> Rep (QName l) x Source #

to :: Rep (QName l) x -> QName l Source #

Generic (Name l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Name l) :: Type -> Type Source #

Methods

from :: Name l -> Rep (Name l) x Source #

to :: Rep (Name l) x -> Name l Source #

Generic (IPName l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (IPName l) :: Type -> Type Source #

Methods

from :: IPName l -> Rep (IPName l) x Source #

to :: Rep (IPName l) x -> IPName l Source #

Generic (QOp l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (QOp l) :: Type -> Type Source #

Methods

from :: QOp l -> Rep (QOp l) x Source #

to :: Rep (QOp l) x -> QOp l Source #

Generic (Op l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Op l) :: Type -> Type Source #

Methods

from :: Op l -> Rep (Op l) x Source #

to :: Rep (Op l) x -> Op l Source #

Generic (CName l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (CName l) :: Type -> Type Source #

Methods

from :: CName l -> Rep (CName l) x Source #

to :: Rep (CName l) x -> CName l Source #

Generic (Module l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Module l) :: Type -> Type Source #

Methods

from :: Module l -> Rep (Module l) x Source #

to :: Rep (Module l) x -> Module l Source #

Generic (ModuleHead l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ModuleHead l) :: Type -> Type Source #

Methods

from :: ModuleHead l -> Rep (ModuleHead l) x Source #

to :: Rep (ModuleHead l) x -> ModuleHead l Source #

Generic (ExportSpecList l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ExportSpecList l) :: Type -> Type Source #

Generic (ExportSpec l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ExportSpec l) :: Type -> Type Source #

Methods

from :: ExportSpec l -> Rep (ExportSpec l) x Source #

to :: Rep (ExportSpec l) x -> ExportSpec l Source #

Generic (EWildcard l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (EWildcard l) :: Type -> Type Source #

Methods

from :: EWildcard l -> Rep (EWildcard l) x Source #

to :: Rep (EWildcard l) x -> EWildcard l Source #

Generic (Namespace l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Namespace l) :: Type -> Type Source #

Methods

from :: Namespace l -> Rep (Namespace l) x Source #

to :: Rep (Namespace l) x -> Namespace l Source #

Generic (ImportDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ImportDecl l) :: Type -> Type Source #

Methods

from :: ImportDecl l -> Rep (ImportDecl l) x Source #

to :: Rep (ImportDecl l) x -> ImportDecl l Source #

Generic (ImportSpecList l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ImportSpecList l) :: Type -> Type Source #

Generic (ImportSpec l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ImportSpec l) :: Type -> Type Source #

Methods

from :: ImportSpec l -> Rep (ImportSpec l) x Source #

to :: Rep (ImportSpec l) x -> ImportSpec l Source #

Generic (Assoc l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Assoc l) :: Type -> Type Source #

Methods

from :: Assoc l -> Rep (Assoc l) x Source #

to :: Rep (Assoc l) x -> Assoc l Source #

Generic (Decl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Decl l) :: Type -> Type Source #

Methods

from :: Decl l -> Rep (Decl l) x Source #

to :: Rep (Decl l) x -> Decl l Source #

Generic (PatternSynDirection l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (PatternSynDirection l) :: Type -> Type Source #

Generic (TypeEqn l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (TypeEqn l) :: Type -> Type Source #

Methods

from :: TypeEqn l -> Rep (TypeEqn l) x Source #

to :: Rep (TypeEqn l) x -> TypeEqn l Source #

Generic (Annotation l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Annotation l) :: Type -> Type Source #

Methods

from :: Annotation l -> Rep (Annotation l) x Source #

to :: Rep (Annotation l) x -> Annotation l Source #

Generic (BooleanFormula l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (BooleanFormula l) :: Type -> Type Source #

Generic (Role l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Role l) :: Type -> Type Source #

Methods

from :: Role l -> Rep (Role l) x Source #

to :: Rep (Role l) x -> Role l Source #

Generic (DataOrNew l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (DataOrNew l) :: Type -> Type Source #

Methods

from :: DataOrNew l -> Rep (DataOrNew l) x Source #

to :: Rep (DataOrNew l) x -> DataOrNew l Source #

Generic (InjectivityInfo l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (InjectivityInfo l) :: Type -> Type Source #

Generic (ResultSig l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ResultSig l) :: Type -> Type Source #

Methods

from :: ResultSig l -> Rep (ResultSig l) x Source #

to :: Rep (ResultSig l) x -> ResultSig l Source #

Generic (DeclHead l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (DeclHead l) :: Type -> Type Source #

Methods

from :: DeclHead l -> Rep (DeclHead l) x Source #

to :: Rep (DeclHead l) x -> DeclHead l Source #

Generic (InstRule l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (InstRule l) :: Type -> Type Source #

Methods

from :: InstRule l -> Rep (InstRule l) x Source #

to :: Rep (InstRule l) x -> InstRule l Source #

Generic (InstHead l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (InstHead l) :: Type -> Type Source #

Methods

from :: InstHead l -> Rep (InstHead l) x Source #

to :: Rep (InstHead l) x -> InstHead l Source #

Generic (Deriving l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Deriving l) :: Type -> Type Source #

Methods

from :: Deriving l -> Rep (Deriving l) x Source #

to :: Rep (Deriving l) x -> Deriving l Source #

Generic (DerivStrategy l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (DerivStrategy l) :: Type -> Type Source #

Generic (Binds l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Binds l) :: Type -> Type Source #

Methods

from :: Binds l -> Rep (Binds l) x Source #

to :: Rep (Binds l) x -> Binds l Source #

Generic (IPBind l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (IPBind l) :: Type -> Type Source #

Methods

from :: IPBind l -> Rep (IPBind l) x Source #

to :: Rep (IPBind l) x -> IPBind l Source #

Generic (Match l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Match l) :: Type -> Type Source #

Methods

from :: Match l -> Rep (Match l) x Source #

to :: Rep (Match l) x -> Match l Source #

Generic (QualConDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (QualConDecl l) :: Type -> Type Source #

Generic (ConDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ConDecl l) :: Type -> Type Source #

Methods

from :: ConDecl l -> Rep (ConDecl l) x Source #

to :: Rep (ConDecl l) x -> ConDecl l Source #

Generic (FieldDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (FieldDecl l) :: Type -> Type Source #

Methods

from :: FieldDecl l -> Rep (FieldDecl l) x Source #

to :: Rep (FieldDecl l) x -> FieldDecl l Source #

Generic (GadtDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (GadtDecl l) :: Type -> Type Source #

Methods

from :: GadtDecl l -> Rep (GadtDecl l) x Source #

to :: Rep (GadtDecl l) x -> GadtDecl l Source #

Generic (ClassDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ClassDecl l) :: Type -> Type Source #

Methods

from :: ClassDecl l -> Rep (ClassDecl l) x Source #

to :: Rep (ClassDecl l) x -> ClassDecl l Source #

Generic (InstDecl l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (InstDecl l) :: Type -> Type Source #

Methods

from :: InstDecl l -> Rep (InstDecl l) x Source #

to :: Rep (InstDecl l) x -> InstDecl l Source #

Generic (BangType l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (BangType l) :: Type -> Type Source #

Methods

from :: BangType l -> Rep (BangType l) x Source #

to :: Rep (BangType l) x -> BangType l Source #

Generic (Unpackedness l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Unpackedness l) :: Type -> Type Source #

Generic (Rhs l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Rhs l) :: Type -> Type Source #

Methods

from :: Rhs l -> Rep (Rhs l) x Source #

to :: Rep (Rhs l) x -> Rhs l Source #

Generic (GuardedRhs l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (GuardedRhs l) :: Type -> Type Source #

Methods

from :: GuardedRhs l -> Rep (GuardedRhs l) x Source #

to :: Rep (GuardedRhs l) x -> GuardedRhs l Source #

Generic (Type l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Type l) :: Type -> Type Source #

Methods

from :: Type l -> Rep (Type l) x Source #

to :: Rep (Type l) x -> Type l Source #

Generic (MaybePromotedName l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (MaybePromotedName l) :: Type -> Type Source #

Generic (Promoted l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Promoted l) :: Type -> Type Source #

Methods

from :: Promoted l -> Rep (Promoted l) x Source #

to :: Rep (Promoted l) x -> Promoted l Source #

Generic (TyVarBind l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (TyVarBind l) :: Type -> Type Source #

Methods

from :: TyVarBind l -> Rep (TyVarBind l) x Source #

to :: Rep (TyVarBind l) x -> TyVarBind l Source #

Generic (FunDep l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (FunDep l) :: Type -> Type Source #

Methods

from :: FunDep l -> Rep (FunDep l) x Source #

to :: Rep (FunDep l) x -> FunDep l Source #

Generic (Context l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Context l) :: Type -> Type Source #

Methods

from :: Context l -> Rep (Context l) x Source #

to :: Rep (Context l) x -> Context l Source #

Generic (Asst l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Asst l) :: Type -> Type Source #

Methods

from :: Asst l -> Rep (Asst l) x Source #

to :: Rep (Asst l) x -> Asst l Source #

Generic (Literal l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Literal l) :: Type -> Type Source #

Methods

from :: Literal l -> Rep (Literal l) x Source #

to :: Rep (Literal l) x -> Literal l Source #

Generic (Sign l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Sign l) :: Type -> Type Source #

Methods

from :: Sign l -> Rep (Sign l) x Source #

to :: Rep (Sign l) x -> Sign l Source #

Generic (Exp l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Exp l) :: Type -> Type Source #

Methods

from :: Exp l -> Rep (Exp l) x Source #

to :: Rep (Exp l) x -> Exp l Source #

Generic (XName l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (XName l) :: Type -> Type Source #

Methods

from :: XName l -> Rep (XName l) x Source #

to :: Rep (XName l) x -> XName l Source #

Generic (XAttr l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (XAttr l) :: Type -> Type Source #

Methods

from :: XAttr l -> Rep (XAttr l) x Source #

to :: Rep (XAttr l) x -> XAttr l Source #

Generic (Bracket l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Bracket l) :: Type -> Type Source #

Methods

from :: Bracket l -> Rep (Bracket l) x Source #

to :: Rep (Bracket l) x -> Bracket l Source #

Generic (Splice l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Splice l) :: Type -> Type Source #

Methods

from :: Splice l -> Rep (Splice l) x Source #

to :: Rep (Splice l) x -> Splice l Source #

Generic (Safety l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Safety l) :: Type -> Type Source #

Methods

from :: Safety l -> Rep (Safety l) x Source #

to :: Rep (Safety l) x -> Safety l Source #

Generic (CallConv l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (CallConv l) :: Type -> Type Source #

Methods

from :: CallConv l -> Rep (CallConv l) x Source #

to :: Rep (CallConv l) x -> CallConv l Source #

Generic (ModulePragma l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (ModulePragma l) :: Type -> Type Source #

Generic (Overlap l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Overlap l) :: Type -> Type Source #

Methods

from :: Overlap l -> Rep (Overlap l) x Source #

to :: Rep (Overlap l) x -> Overlap l Source #

Generic (Activation l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Activation l) :: Type -> Type Source #

Methods

from :: Activation l -> Rep (Activation l) x Source #

to :: Rep (Activation l) x -> Activation l Source #

Generic (Rule l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Rule l) :: Type -> Type Source #

Methods

from :: Rule l -> Rep (Rule l) x Source #

to :: Rep (Rule l) x -> Rule l Source #

Generic (RuleVar l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (RuleVar l) :: Type -> Type Source #

Methods

from :: RuleVar l -> Rep (RuleVar l) x Source #

to :: Rep (RuleVar l) x -> RuleVar l Source #

Generic (WarningText l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (WarningText l) :: Type -> Type Source #

Generic (Pat l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Pat l) :: Type -> Type Source #

Methods

from :: Pat l -> Rep (Pat l) x Source #

to :: Rep (Pat l) x -> Pat l Source #

Generic (PXAttr l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (PXAttr l) :: Type -> Type Source #

Methods

from :: PXAttr l -> Rep (PXAttr l) x Source #

to :: Rep (PXAttr l) x -> PXAttr l Source #

Generic (RPatOp l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (RPatOp l) :: Type -> Type Source #

Methods

from :: RPatOp l -> Rep (RPatOp l) x Source #

to :: Rep (RPatOp l) x -> RPatOp l Source #

Generic (RPat l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (RPat l) :: Type -> Type Source #

Methods

from :: RPat l -> Rep (RPat l) x Source #

to :: Rep (RPat l) x -> RPat l Source #

Generic (PatField l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (PatField l) :: Type -> Type Source #

Methods

from :: PatField l -> Rep (PatField l) x Source #

to :: Rep (PatField l) x -> PatField l Source #

Generic (Stmt l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Stmt l) :: Type -> Type Source #

Methods

from :: Stmt l -> Rep (Stmt l) x Source #

to :: Rep (Stmt l) x -> Stmt l Source #

Generic (QualStmt l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (QualStmt l) :: Type -> Type Source #

Methods

from :: QualStmt l -> Rep (QualStmt l) x Source #

to :: Rep (QualStmt l) x -> QualStmt l Source #

Generic (FieldUpdate l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (FieldUpdate l) :: Type -> Type Source #

Generic (Alt l) 
Instance details

Defined in Language.Haskell.Exts.Syntax

Associated Types

type Rep (Alt l) :: Type -> Type Source #

Methods

from :: Alt l -> Rep (Alt l) x Source #

to :: Rep (Alt l) x -> Alt l Source #

Generic (Loc a) 
Instance details

Defined in Language.Haskell.Exts.SrcLoc

Associated Types

type Rep (Loc a) :: Type -> Type Source #

Methods

from :: Loc a -> Rep (Loc a) x Source #

to :: Rep (Loc a) x -> Loc a Source #

Generic (Doc a) 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep (Doc a) :: Type -> Type Source #

Methods

from :: Doc a -> Rep (Doc a) x Source #

to :: Rep (Doc a) x -> Doc a Source #

Generic (Maybe a) 
Instance details

Defined in Data.Strict.Maybe

Associated Types

type Rep (Maybe a) :: Type -> Type Source #

Methods

from :: Maybe a -> Rep (Maybe a) x Source #

to :: Rep (Maybe a) x -> Maybe a Source #

Generic (PrimitiveGuard a) Source # 
Instance details

Defined in Clash.Annotations.Primitive

Associated Types

type Rep (PrimitiveGuard a) :: Type -> Type Source #

Generic (BitVector n) Source # 
Instance details

Defined in Clash.Sized.Internal.BitVector

Associated Types

type Rep (BitVector n) :: Type -> Type Source #

Methods

from :: BitVector n -> Rep (BitVector n) x Source #

to :: Rep (BitVector n) x -> BitVector n Source #

Generic (Index n) Source # 
Instance details

Defined in Clash.Sized.Internal.Index

Associated Types

type Rep (Index n) :: Type -> Type Source #

Methods

from :: Index n -> Rep (Index n) x Source #

to :: Rep (Index n) x -> Index n Source #

Generic (Unsigned n) Source # 
Instance details

Defined in Clash.Sized.Internal.Unsigned

Associated Types

type Rep (Unsigned n) :: Type -> Type Source #

Methods

from :: Unsigned n -> Rep (Unsigned n) x Source #

to :: Rep (Unsigned n) x -> Unsigned n Source #

Generic (Signed n) Source # 
Instance details

Defined in Clash.Sized.Internal.Signed

Associated Types

type Rep (Signed n) :: Type -> Type Source #

Methods

from :: Signed n -> Rep (Signed n) x Source #

to :: Rep (Signed n) x -> Signed n Source #

Generic (Attr a) Source # 
Instance details

Defined in Clash.Annotations.SynthesisAttributes

Associated Types

type Rep (Attr a) :: Type -> Type Source #

Methods

from :: Attr a -> Rep (Attr a) x Source #

to :: Rep (Attr a) x -> Attr a Source #

Generic (Overflowing a) Source # 
Instance details

Defined in Clash.Num.Overflowing

Associated Types

type Rep (Overflowing a) :: Type -> Type Source #

Generic (Either a b)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Either a b) :: Type -> Type Source #

Methods

from :: Either a b -> Rep (Either a b) x Source #

to :: Rep (Either a b) x -> Either a b Source #

Generic (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (V1 p) :: Type -> Type Source #

Methods

from :: V1 p -> Rep (V1 p) x Source #

to :: Rep (V1 p) x -> V1 p Source #

Generic (U1 p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (U1 p) :: Type -> Type Source #

Methods

from :: U1 p -> Rep (U1 p) x Source #

to :: Rep (U1 p) x -> U1 p Source #

Generic (a, b)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b) :: Type -> Type Source #

Methods

from :: (a, b) -> Rep (a, b) x Source #

to :: Rep (a, b) x -> (a, b) Source #

Generic (Arg a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Arg a b) :: Type -> Type Source #

Methods

from :: Arg a b -> Rep (Arg a b) x Source #

to :: Rep (Arg a b) x -> Arg a b Source #

Generic (WrappedMonad m a)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep (WrappedMonad m a) :: Type -> Type Source #

Methods

from :: WrappedMonad m a -> Rep (WrappedMonad m a) x Source #

to :: Rep (WrappedMonad m a) x -> WrappedMonad m a Source #

Generic (Proxy t)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Proxy t) :: Type -> Type Source #

Methods

from :: Proxy t -> Rep (Proxy t) x Source #

to :: Rep (Proxy t) x -> Proxy t Source #

Generic (Free f a) 
Instance details

Defined in Control.Monad.Free

Associated Types

type Rep (Free f a) :: Type -> Type Source #

Methods

from :: Free f a -> Rep (Free f a) x Source #

to :: Rep (Free f a) x -> Free f a Source #

Generic (Cofree f a) 
Instance details

Defined in Control.Comonad.Cofree

Associated Types

type Rep (Cofree f a) :: Type -> Type Source #

Methods

from :: Cofree f a -> Rep (Cofree f a) x Source #

to :: Rep (Cofree f a) x -> Cofree f a Source #

Generic (ListF a b) 
Instance details

Defined in Data.Functor.Base

Associated Types

type Rep (ListF a b) :: Type -> Type Source #

Methods

from :: ListF a b -> Rep (ListF a b) x Source #

to :: Rep (ListF a b) x -> ListF a b Source #

Generic (NonEmptyF a b) 
Instance details

Defined in Data.Functor.Base

Associated Types

type Rep (NonEmptyF a b) :: Type -> Type Source #

Methods

from :: NonEmptyF a b -> Rep (NonEmptyF a b) x Source #

to :: Rep (NonEmptyF a b) x -> NonEmptyF a b Source #

Generic (TreeF a b) 
Instance details

Defined in Data.Functor.Base

Associated Types

type Rep (TreeF a b) :: Type -> Type Source #

Methods

from :: TreeF a b -> Rep (TreeF a b) x Source #

to :: Rep (TreeF a b) x -> TreeF a b Source #

Generic (Pair a b) 
Instance details

Defined in Data.Strict.Tuple

Associated Types

type Rep (Pair a b) :: Type -> Type Source #

Methods

from :: Pair a b -> Rep (Pair a b) x Source #

to :: Rep (Pair a b) x -> Pair a b Source #

Generic (These a b) 
Instance details

Defined in Data.Strict.These

Associated Types

type Rep (These a b) :: Type -> Type Source #

Methods

from :: These a b -> Rep (These a b) x Source #

to :: Rep (These a b) x -> These a b Source #

Generic (Either a b) 
Instance details

Defined in Data.Strict.Either

Associated Types

type Rep (Either a b) :: Type -> Type Source #

Methods

from :: Either a b -> Rep (Either a b) x Source #

to :: Rep (Either a b) x -> Either a b Source #

Generic (These a b) 
Instance details

Defined in Data.These

Associated Types

type Rep (These a b) :: Type -> Type Source #

Methods

from :: These a b -> Rep (These a b) x Source #

to :: Rep (These a b) x -> These a b Source #

KnownNat n => Generic (Vec n a) Source #

In many cases, this Generic instance only allows generic functions/instances over vectors of at least size 1, due to the n-1 in the Rep (Vec n a) definition.

We'll have to wait for things like https://ryanglscott.github.io/2018/02/11/how-to-derive-generic-for-some-gadts/ before we can work around this limitation

Instance details

Defined in Clash.Sized.Vector

Associated Types

type Rep (Vec n a) :: Type -> Type Source #

Methods

from :: Vec n a -> Rep (Vec n a) x Source #

to :: Rep (Vec n a) x -> Vec n a Source #

Generic (RamOp n a) Source # 
Instance details

Defined in Clash.Explicit.BlockRam

Associated Types

type Rep (RamOp n a) :: Type -> Type Source #

Methods

from :: RamOp n a -> Rep (RamOp n a) x Source #

to :: Rep (RamOp n a) x -> RamOp n a Source #

Generic (Rec1 f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Rec1 f p) :: Type -> Type Source #

Methods

from :: Rec1 f p -> Rep (Rec1 f p) x Source #

to :: Rep (Rec1 f p) x -> Rec1 f p Source #

Generic (URec (Ptr ()) p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec (Ptr ()) p) :: Type -> Type Source #

Methods

from :: URec (Ptr ()) p -> Rep (URec (Ptr ()) p) x Source #

to :: Rep (URec (Ptr ()) p) x -> URec (Ptr ()) p Source #

Generic (URec Char p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Char p) :: Type -> Type Source #

Methods

from :: URec Char p -> Rep (URec Char p) x Source #

to :: Rep (URec Char p) x -> URec Char p Source #

Generic (URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Double p) :: Type -> Type Source #

Methods

from :: URec Double p -> Rep (URec Double p) x Source #

to :: Rep (URec Double p) x -> URec Double p Source #

Generic (URec Float p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Float p) :: Type -> Type Source #

Methods

from :: URec Float p -> Rep (URec Float p) x Source #

to :: Rep (URec Float p) x -> URec Float p Source #

Generic (URec Int p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Int p) :: Type -> Type Source #

Methods

from :: URec Int p -> Rep (URec Int p) x Source #

to :: Rep (URec Int p) x -> URec Int p Source #

Generic (URec Word p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Word p) :: Type -> Type Source #

Methods

from :: URec Word p -> Rep (URec Word p) x Source #

to :: Rep (URec Word p) x -> URec Word p Source #

Generic (a, b, c)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c) :: Type -> Type Source #

Methods

from :: (a, b, c) -> Rep (a, b, c) x Source #

to :: Rep (a, b, c) x -> (a, b, c) Source #

Generic (Kleisli m a b)

Since: base-4.14.0.0

Instance details

Defined in Control.Arrow

Associated Types

type Rep (Kleisli m a b) :: Type -> Type Source #

Methods

from :: Kleisli m a b -> Rep (Kleisli m a b) x Source #

to :: Rep (Kleisli m a b) x -> Kleisli m a b Source #

Generic (WrappedArrow a b c)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep (WrappedArrow a b c) :: Type -> Type Source #

Methods

from :: WrappedArrow a b c -> Rep (WrappedArrow a b c) x Source #

to :: Rep (WrappedArrow a b c) x -> WrappedArrow a b c Source #

Generic (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Associated Types

type Rep (Const a b) :: Type -> Type Source #

Methods

from :: Const a b -> Rep (Const a b) x Source #

to :: Rep (Const a b) x -> Const a b Source #

Generic (Ap f a)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep (Ap f a) :: Type -> Type Source #

Methods

from :: Ap f a -> Rep (Ap f a) x Source #

to :: Rep (Ap f a) x -> Ap f a Source #

Generic (Alt f a)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Alt f a) :: Type -> Type Source #

Methods

from :: Alt f a -> Rep (Alt f a) x Source #

to :: Rep (Alt f a) x -> Alt f a Source #

Generic (Join p a) 
Instance details

Defined in Data.Bifunctor.Join

Associated Types

type Rep (Join p a) :: Type -> Type Source #

Methods

from :: Join p a -> Rep (Join p a) x Source #

to :: Rep (Join p a) x -> Join p a Source #

Generic (Fix p a) 
Instance details

Defined in Data.Bifunctor.Fix

Associated Types

type Rep (Fix p a) :: Type -> Type Source #

Methods

from :: Fix p a -> Rep (Fix p a) x Source #

to :: Rep (Fix p a) x -> Fix p a Source #

Generic (FreeF f a b) 
Instance details

Defined in Control.Monad.Trans.Free

Associated Types

type Rep (FreeF f a b) :: Type -> Type Source #

Methods

from :: FreeF f a b -> Rep (FreeF f a b) x Source #

to :: Rep (FreeF f a b) x -> FreeF f a b Source #

Generic (CofreeF f a b) 
Instance details

Defined in Control.Comonad.Trans.Cofree

Associated Types

type Rep (CofreeF f a b) :: Type -> Type Source #

Methods

from :: CofreeF f a b -> Rep (CofreeF f a b) x Source #

to :: Rep (CofreeF f a b) x -> CofreeF f a b Source #

Generic (Tagged s b) 
Instance details

Defined in Data.Tagged

Associated Types

type Rep (Tagged s b) :: Type -> Type Source #

Methods

from :: Tagged s b -> Rep (Tagged s b) x Source #

to :: Rep (Tagged s b) x -> Tagged s b Source #

Generic (K1 i c p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (K1 i c p) :: Type -> Type Source #

Methods

from :: K1 i c p -> Rep (K1 i c p) x Source #

to :: Rep (K1 i c p) x -> K1 i c p Source #

Generic ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :+: g) p) :: Type -> Type Source #

Methods

from :: (f :+: g) p -> Rep ((f :+: g) p) x Source #

to :: Rep ((f :+: g) p) x -> (f :+: g) p Source #

Generic ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :*: g) p) :: Type -> Type Source #

Methods

from :: (f :*: g) p -> Rep ((f :*: g) p) x Source #

to :: Rep ((f :*: g) p) x -> (f :*: g) p Source #

Generic (a, b, c, d)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d) :: Type -> Type Source #

Methods

from :: (a, b, c, d) -> Rep (a, b, c, d) x Source #

to :: Rep (a, b, c, d) x -> (a, b, c, d) Source #

Generic (Product f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Associated Types

type Rep (Product f g a) :: Type -> Type Source #

Methods

from :: Product f g a -> Rep (Product f g a) x Source #

to :: Rep (Product f g a) x -> Product f g a Source #

Generic (Sum f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Associated Types

type Rep (Sum f g a) :: Type -> Type Source #

Methods

from :: Sum f g a -> Rep (Sum f g a) x Source #

to :: Rep (Sum f g a) x -> Sum f g a Source #

Generic (M1 i c f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (M1 i c f p) :: Type -> Type Source #

Methods

from :: M1 i c f p -> Rep (M1 i c f p) x Source #

to :: Rep (M1 i c f p) x -> M1 i c f p Source #

Generic ((f :.: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :.: g) p) :: Type -> Type Source #

Methods

from :: (f :.: g) p -> Rep ((f :.: g) p) x Source #

to :: Rep ((f :.: g) p) x -> (f :.: g) p Source #

Generic (a, b, c, d, e)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e) :: Type -> Type Source #

Methods

from :: (a, b, c, d, e) -> Rep (a, b, c, d, e) x Source #

to :: Rep (a, b, c, d, e) x -> (a, b, c, d, e) Source #

Generic (Compose f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Associated Types

type Rep (Compose f g a) :: Type -> Type Source #

Methods

from :: Compose f g a -> Rep (Compose f g a) x Source #

to :: Rep (Compose f g a) x -> Compose f g a Source #

Generic (WrappedBifunctor p a b) 
Instance details

Defined in Data.Bifunctor.Wrapped

Associated Types

type Rep (WrappedBifunctor p a b) :: Type -> Type Source #

Methods

from :: WrappedBifunctor p a b -> Rep (WrappedBifunctor p a b) x Source #

to :: Rep (WrappedBifunctor p a b) x -> WrappedBifunctor p a b Source #

Generic (Joker g a b) 
Instance details

Defined in Data.Bifunctor.Joker

Associated Types

type Rep (Joker g a b) :: Type -> Type Source #

Methods

from :: Joker g a b -> Rep (Joker g a b) x Source #

to :: Rep (Joker g a b) x -> Joker g a b Source #

Generic (Flip p a b) 
Instance details

Defined in Data.Bifunctor.Flip

Associated Types

type Rep (Flip p a b) :: Type -> Type Source #

Methods

from :: Flip p a b -> Rep (Flip p a b) x Source #

to :: Rep (Flip p a b) x -> Flip p a b Source #

Generic (Clown f a b) 
Instance details

Defined in Data.Bifunctor.Clown

Associated Types

type Rep (Clown f a b) :: Type -> Type Source #

Methods

from :: Clown f a b -> Rep (Clown f a b) x Source #

to :: Rep (Clown f a b) x -> Clown f a b Source #

Generic (a, b, c, d, e, f)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f) :: Type -> Type Source #

Methods

from :: (a, b, c, d, e, f) -> Rep (a, b, c, d, e, f) x Source #

to :: Rep (a, b, c, d, e, f) x -> (a, b, c, d, e, f) Source #

Generic (Sum p q a b) 
Instance details

Defined in Data.Bifunctor.Sum

Associated Types

type Rep (Sum p q a b) :: Type -> Type Source #

Methods

from :: Sum p q a b -> Rep (Sum p q a b) x Source #

to :: Rep (Sum p q a b) x -> Sum p q a b Source #

Generic (Product f g a b) 
Instance details

Defined in Data.Bifunctor.Product

Associated Types

type Rep (Product f g a b) :: Type -> Type Source #

Methods

from :: Product f g a b -> Rep (Product f g a b) x Source #

to :: Rep (Product f g a b) x -> Product f g a b Source #

Generic (a, b, c, d, e, f, g)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f, g) :: Type -> Type Source #

Methods

from :: (a, b, c, d, e, f, g) -> Rep (a, b, c, d, e, f, g) x Source #

to :: Rep (a, b, c, d, e, f, g) x -> (a, b, c, d, e, f, g) Source #

Generic (Tannen f p a b) 
Instance details

Defined in Data.Bifunctor.Tannen

Associated Types

type Rep (Tannen f p a b) :: Type -> Type Source #

Methods

from :: Tannen f p a b -> Rep (Tannen f p a b) x Source #

to :: Rep (Tannen f p a b) x -> Tannen f p a b Source #

Generic (Biff p f g a b) 
Instance details

Defined in Data.Bifunctor.Biff

Associated Types

type Rep (Biff p f g a b) :: Type -> Type Source #

Methods

from :: Biff p f g a b -> Rep (Biff p f g a b) x Source #

to :: Rep (Biff p f g a b) x -> Biff p f g a b Source #

class Generic1 (f :: k -> Type) Source #

Representable types of kind * -> * (or kind k -> *, when PolyKinds is enabled). This class is derivable in GHC with the DeriveGeneric flag on.

A Generic1 instance must satisfy the following laws:

from1 . to1id
to1 . from1id

Minimal complete definition

from1, to1

Instances

Instances details
Generic1 (V1 :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 V1 :: k -> Type Source #

Methods

from1 :: forall (a :: k0). V1 a -> Rep1 V1 a Source #

to1 :: forall (a :: k0). Rep1 V1 a -> V1 a Source #

Generic1 (U1 :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 U1 :: k -> Type Source #

Methods

from1 :: forall (a :: k0). U1 a -> Rep1 U1 a Source #

to1 :: forall (a :: k0). Rep1 U1 a -> U1 a Source #

Generic1 (Proxy :: k -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Proxy :: k -> Type Source #

Methods

from1 :: forall (a :: k0). Proxy a -> Rep1 Proxy a Source #

to1 :: forall (a :: k0). Rep1 Proxy a -> Proxy a Source #

Generic1 (Alt f :: k -> Type)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep1 (Alt f) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). Alt f a -> Rep1 (Alt f) a Source #

to1 :: forall (a :: k0). Rep1 (Alt f) a -> Alt f a Source #

Generic1 (Ap f :: k -> Type)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep1 (Ap f) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). Ap f a -> Rep1 (Ap f) a Source #

to1 :: forall (a :: k0). Rep1 (Ap f) a -> Ap f a Source #

Generic1 (Const a :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Associated Types

type Rep1 (Const a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k0). Const a a0 -> Rep1 (Const a) a0 Source #

to1 :: forall (a0 :: k0). Rep1 (Const a) a0 -> Const a a0 Source #

Generic1 (URec (Ptr ()) :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec (Ptr ())) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). URec (Ptr ()) a -> Rep1 (URec (Ptr ())) a Source #

to1 :: forall (a :: k0). Rep1 (URec (Ptr ())) a -> URec (Ptr ()) a Source #

Generic1 (URec Char :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Char) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). URec Char a -> Rep1 (URec Char) a Source #

to1 :: forall (a :: k0). Rep1 (URec Char) a -> URec Char a Source #

Generic1 (URec Double :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Double) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). URec Double a -> Rep1 (URec Double) a Source #

to1 :: forall (a :: k0). Rep1 (URec Double) a -> URec Double a Source #

Generic1 (URec Float :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Float) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). URec Float a -> Rep1 (URec Float) a Source #

to1 :: forall (a :: k0). Rep1 (URec Float) a -> URec Float a Source #

Generic1 (URec Int :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Int) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). URec Int a -> Rep1 (URec Int) a Source #

to1 :: forall (a :: k0). Rep1 (URec Int) a -> URec Int a Source #

Generic1 (URec Word :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Word) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). URec Word a -> Rep1 (URec Word) a Source #

to1 :: forall (a :: k0). Rep1 (URec Word) a -> URec Word a Source #

Generic1 (Rec1 f :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (Rec1 f) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). Rec1 f a -> Rep1 (Rec1 f) a Source #

to1 :: forall (a :: k0). Rep1 (Rec1 f) a -> Rec1 f a Source #

Generic1 (Sum f g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Associated Types

type Rep1 (Sum f g) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). Sum f g a -> Rep1 (Sum f g) a Source #

to1 :: forall (a :: k0). Rep1 (Sum f g) a -> Sum f g a Source #

Generic1 (Product f g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Associated Types

type Rep1 (Product f g) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). Product f g a -> Rep1 (Product f g) a Source #

to1 :: forall (a :: k0). Rep1 (Product f g) a -> Product f g a Source #

Generic1 (K1 i c :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (K1 i c) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). K1 i c a -> Rep1 (K1 i c) a Source #

to1 :: forall (a :: k0). Rep1 (K1 i c) a -> K1 i c a Source #

Generic1 (f :+: g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (f :+: g) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). (f :+: g) a -> Rep1 (f :+: g) a Source #

to1 :: forall (a :: k0). Rep1 (f :+: g) a -> (f :+: g) a Source #

Generic1 (f :*: g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (f :*: g) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). (f :*: g) a -> Rep1 (f :*: g) a Source #

to1 :: forall (a :: k0). Rep1 (f :*: g) a -> (f :*: g) a Source #

Generic1 (WrappedBifunctor p a :: k1 -> Type) 
Instance details

Defined in Data.Bifunctor.Wrapped

Associated Types

type Rep1 (WrappedBifunctor p a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). WrappedBifunctor p a a0 -> Rep1 (WrappedBifunctor p a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (WrappedBifunctor p a) a0 -> WrappedBifunctor p a a0 Source #

Generic1 (Joker g a :: k1 -> Type) 
Instance details

Defined in Data.Bifunctor.Joker

Associated Types

type Rep1 (Joker g a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). Joker g a a0 -> Rep1 (Joker g a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (Joker g a) a0 -> Joker g a a0 Source #

Generic1 (Clown f a :: k1 -> Type) 
Instance details

Defined in Data.Bifunctor.Clown

Associated Types

type Rep1 (Clown f a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). Clown f a a0 -> Rep1 (Clown f a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (Clown f a) a0 -> Clown f a a0 Source #

Functor f => Generic1 (Compose f g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Associated Types

type Rep1 (Compose f g) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). Compose f g a -> Rep1 (Compose f g) a Source #

to1 :: forall (a :: k0). Rep1 (Compose f g) a -> Compose f g a Source #

Generic1 (M1 i c f :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (M1 i c f) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). M1 i c f a -> Rep1 (M1 i c f) a Source #

to1 :: forall (a :: k0). Rep1 (M1 i c f) a -> M1 i c f a Source #

Functor f => Generic1 (f :.: g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (f :.: g) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). (f :.: g) a -> Rep1 (f :.: g) a Source #

to1 :: forall (a :: k0). Rep1 (f :.: g) a -> (f :.: g) a Source #

Generic1 (Sum p q a :: k1 -> Type) 
Instance details

Defined in Data.Bifunctor.Sum

Associated Types

type Rep1 (Sum p q a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). Sum p q a a0 -> Rep1 (Sum p q a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (Sum p q a) a0 -> Sum p q a a0 Source #

Generic1 (Product f g a :: k1 -> Type) 
Instance details

Defined in Data.Bifunctor.Product

Associated Types

type Rep1 (Product f g a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). Product f g a a0 -> Rep1 (Product f g a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (Product f g a) a0 -> Product f g a a0 Source #

Functor f => Generic1 (Tannen f p a :: k2 -> Type) 
Instance details

Defined in Data.Bifunctor.Tannen

Associated Types

type Rep1 (Tannen f p a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). Tannen f p a a0 -> Rep1 (Tannen f p a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (Tannen f p a) a0 -> Tannen f p a a0 Source #

Functor (p (f a)) => Generic1 (Biff p f g a :: k3 -> Type) 
Instance details

Defined in Data.Bifunctor.Biff

Associated Types

type Rep1 (Biff p f g a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). Biff p f g a a0 -> Rep1 (Biff p f g a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (Biff p f g a) a0 -> Biff p f g a a0 Source #

Generic1 []

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 [] :: k -> Type Source #

Methods

from1 :: forall (a :: k). [a] -> Rep1 [] a Source #

to1 :: forall (a :: k). Rep1 [] a -> [a] Source #

Generic1 Maybe

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Maybe :: k -> Type Source #

Methods

from1 :: forall (a :: k). Maybe a -> Rep1 Maybe a Source #

to1 :: forall (a :: k). Rep1 Maybe a -> Maybe a Source #

Generic1 Par1

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Par1 :: k -> Type Source #

Methods

from1 :: forall (a :: k). Par1 a -> Rep1 Par1 a Source #

to1 :: forall (a :: k). Rep1 Par1 a -> Par1 a Source #

Generic1 Solo 
Instance details

Defined in Data.Tuple.Solo

Associated Types

type Rep1 Solo :: k -> Type Source #

Methods

from1 :: forall (a :: k). Solo a -> Rep1 Solo a Source #

to1 :: forall (a :: k). Rep1 Solo a -> Solo a Source #

Generic1 Complex

Since: base-4.9.0.0

Instance details

Defined in Data.Complex

Associated Types

type Rep1 Complex :: k -> Type Source #

Methods

from1 :: forall (a :: k). Complex a -> Rep1 Complex a Source #

to1 :: forall (a :: k). Rep1 Complex a -> Complex a Source #

Generic1 Min

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 Min :: k -> Type Source #

Methods

from1 :: forall (a :: k). Min a -> Rep1 Min a Source #

to1 :: forall (a :: k). Rep1 Min a -> Min a Source #

Generic1 Max

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 Max :: k -> Type Source #

Methods

from1 :: forall (a :: k). Max a -> Rep1 Max a Source #

to1 :: forall (a :: k). Rep1 Max a -> Max a Source #

Generic1 First

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 First :: k -> Type Source #

Methods

from1 :: forall (a :: k). First a -> Rep1 First a Source #

to1 :: forall (a :: k). Rep1 First a -> First a Source #

Generic1 Last

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 Last :: k -> Type Source #

Methods

from1 :: forall (a :: k). Last a -> Rep1 Last a Source #

to1 :: forall (a :: k). Rep1 Last a -> Last a Source #

Generic1 WrappedMonoid

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 WrappedMonoid :: k -> Type Source #

Methods

from1 :: forall (a :: k). WrappedMonoid a -> Rep1 WrappedMonoid a Source #

to1 :: forall (a :: k). Rep1 WrappedMonoid a -> WrappedMonoid a Source #

Generic1 Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 Option :: k -> Type Source #

Methods

from1 :: forall (a :: k). Option a -> Rep1 Option a Source #

to1 :: forall (a :: k). Rep1 Option a -> Option a Source #

Generic1 ZipList

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep1 ZipList :: k -> Type Source #

Methods

from1 :: forall (a :: k). ZipList a -> Rep1 ZipList a Source #

to1 :: forall (a :: k). Rep1 ZipList a -> ZipList a Source #

Generic1 Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Associated Types

type Rep1 Identity :: k -> Type Source #

Methods

from1 :: forall (a :: k). Identity a -> Rep1 Identity a Source #

to1 :: forall (a :: k). Rep1 Identity a -> Identity a Source #

Generic1 First

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep1 First :: k -> Type Source #

Methods

from1 :: forall (a :: k). First a -> Rep1 First a Source #

to1 :: forall (a :: k). Rep1 First a -> First a Source #

Generic1 Last

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep1 Last :: k -> Type Source #

Methods

from1 :: forall (a :: k). Last a -> Rep1 Last a Source #

to1 :: forall (a :: k). Rep1 Last a -> Last a Source #

Generic1 Dual

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep1 Dual :: k -> Type Source #

Methods

from1 :: forall (a :: k). Dual a -> Rep1 Dual a Source #

to1 :: forall (a :: k). Rep1 Dual a -> Dual a Source #

Generic1 Sum

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep1 Sum :: k -> Type Source #

Methods

from1 :: forall (a :: k). Sum a -> Rep1 Sum a Source #

to1 :: forall (a :: k). Rep1 Sum a -> Sum a Source #

Generic1 Product

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep1 Product :: k -> Type Source #

Methods

from1 :: forall (a :: k). Product a -> Rep1 Product a Source #

to1 :: forall (a :: k). Rep1 Product a -> Product a Source #

Generic1 Down

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Down :: k -> Type Source #

Methods

from1 :: forall (a :: k). Down a -> Rep1 Down a Source #

to1 :: forall (a :: k). Rep1 Down a -> Down a Source #

Generic1 NonEmpty

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 NonEmpty :: k -> Type Source #

Methods

from1 :: forall (a :: k). NonEmpty a -> Rep1 NonEmpty a Source #

to1 :: forall (a :: k). Rep1 NonEmpty a -> NonEmpty a Source #

Generic1 Tree

Since: containers-0.5.8

Instance details

Defined in Data.Tree

Associated Types

type Rep1 Tree :: k -> Type Source #

Methods

from1 :: forall (a :: k). Tree a -> Rep1 Tree a Source #

to1 :: forall (a :: k). Rep1 Tree a -> Tree a Source #

Generic1 FingerTree

Since: containers-0.6.1

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep1 FingerTree :: k -> Type Source #

Methods

from1 :: forall (a :: k). FingerTree a -> Rep1 FingerTree a Source #

to1 :: forall (a :: k). Rep1 FingerTree a -> FingerTree a Source #

Generic1 Digit

Since: containers-0.6.1

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep1 Digit :: k -> Type Source #

Methods

from1 :: forall (a :: k). Digit a -> Rep1 Digit a Source #

to1 :: forall (a :: k). Rep1 Digit a -> Digit a Source #

Generic1 Node

Since: containers-0.6.1

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep1 Node :: k -> Type Source #

Methods

from1 :: forall (a :: k). Node a -> Rep1 Node a Source #

to1 :: forall (a :: k). Rep1 Node a -> Node a Source #

Generic1 Elem

Since: containers-0.6.1

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep1 Elem :: k -> Type Source #

Methods

from1 :: forall (a :: k). Elem a -> Rep1 Elem a Source #

to1 :: forall (a :: k). Rep1 Elem a -> Elem a Source #

Generic1 ViewL

Since: containers-0.5.8

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep1 ViewL :: k -> Type Source #

Methods

from1 :: forall (a :: k). ViewL a -> Rep1 ViewL a Source #

to1 :: forall (a :: k). Rep1 ViewL a -> ViewL a Source #

Generic1 ViewR

Since: containers-0.5.8

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep1 ViewR :: k -> Type Source #

Methods

from1 :: forall (a :: k). ViewR a -> Rep1 ViewR a Source #

to1 :: forall (a :: k). Rep1 ViewR a -> ViewR a Source #

Generic1 Maybe 
Instance details

Defined in Data.Strict.Maybe

Associated Types

type Rep1 Maybe :: k -> Type Source #

Methods

from1 :: forall (a :: k). Maybe a -> Rep1 Maybe a Source #

to1 :: forall (a :: k). Rep1 Maybe a -> Maybe a Source #

Generic1 (Either a :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (Either a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). Either a a0 -> Rep1 (Either a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (Either a) a0 -> Either a a0 Source #

Generic1 ((,) a :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ((,) a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). (a, a0) -> Rep1 ((,) a) a0 Source #

to1 :: forall (a0 :: k). Rep1 ((,) a) a0 -> (a, a0) Source #

Generic1 (Arg a :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 (Arg a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). Arg a a0 -> Rep1 (Arg a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (Arg a) a0 -> Arg a a0 Source #

Generic1 (WrappedMonad m :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep1 (WrappedMonad m) :: k -> Type Source #

Methods

from1 :: forall (a :: k). WrappedMonad m a -> Rep1 (WrappedMonad m) a Source #

to1 :: forall (a :: k). Rep1 (WrappedMonad m) a -> WrappedMonad m a Source #

Functor f => Generic1 (Free f :: Type -> Type) 
Instance details

Defined in Control.Monad.Free

Associated Types

type Rep1 (Free f) :: k -> Type Source #

Methods

from1 :: forall (a :: k). Free f a -> Rep1 (Free f) a Source #

to1 :: forall (a :: k). Rep1 (Free f) a -> Free f a Source #

Functor f => Generic1 (Cofree f :: Type -> Type) 
Instance details

Defined in Control.Comonad.Cofree

Associated Types

type Rep1 (Cofree f) :: k -> Type Source #

Methods

from1 :: forall (a :: k). Cofree f a -> Rep1 (Cofree f) a Source #

to1 :: forall (a :: k). Rep1 (Cofree f) a -> Cofree f a Source #

Generic1 (ListF a :: Type -> Type) 
Instance details

Defined in Data.Functor.Base

Associated Types

type Rep1 (ListF a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). ListF a a0 -> Rep1 (ListF a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (ListF a) a0 -> ListF a a0 Source #

Generic1 (NonEmptyF a :: Type -> Type) 
Instance details

Defined in Data.Functor.Base

Associated Types

type Rep1 (NonEmptyF a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). NonEmptyF a a0 -> Rep1 (NonEmptyF a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (NonEmptyF a) a0 -> NonEmptyF a a0 Source #

Generic1 (TreeF a :: Type -> Type) 
Instance details

Defined in Data.Functor.Base

Associated Types

type Rep1 (TreeF a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). TreeF a a0 -> Rep1 (TreeF a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (TreeF a) a0 -> TreeF a a0 Source #

Generic1 (Pair a :: Type -> Type) 
Instance details

Defined in Data.Strict.Tuple

Associated Types

type Rep1 (Pair a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). Pair a a0 -> Rep1 (Pair a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (Pair a) a0 -> Pair a a0 Source #

Generic1 (These a :: Type -> Type) 
Instance details

Defined in Data.Strict.These

Associated Types

type Rep1 (These a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). These a a0 -> Rep1 (These a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (These a) a0 -> These a a0 Source #

Generic1 (Either a :: Type -> Type) 
Instance details

Defined in Data.Strict.Either

Associated Types

type Rep1 (Either a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). Either a a0 -> Rep1 (Either a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (Either a) a0 -> Either a a0 Source #

Generic1 (These a :: Type -> Type) 
Instance details

Defined in Data.These

Associated Types

type Rep1 (These a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). These a a0 -> Rep1 (These a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (These a) a0 -> These a a0 Source #

Generic1 ((,,) a b :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ((,,) a b) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). (a, b, a0) -> Rep1 ((,,) a b) a0 Source #

to1 :: forall (a0 :: k). Rep1 ((,,) a b) a0 -> (a, b, a0) Source #

Generic1 (Kleisli m a :: Type -> Type)

Since: base-4.14.0.0

Instance details

Defined in Control.Arrow

Associated Types

type Rep1 (Kleisli m a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). Kleisli m a a0 -> Rep1 (Kleisli m a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (Kleisli m a) a0 -> Kleisli m a a0 Source #

Generic1 (WrappedArrow a b :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep1 (WrappedArrow a b) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). WrappedArrow a b a0 -> Rep1 (WrappedArrow a b) a0 Source #

to1 :: forall (a0 :: k). Rep1 (WrappedArrow a b) a0 -> WrappedArrow a b a0 Source #

Generic1 (FreeF f a :: Type -> Type) 
Instance details

Defined in Control.Monad.Trans.Free

Associated Types

type Rep1 (FreeF f a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). FreeF f a a0 -> Rep1 (FreeF f a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (FreeF f a) a0 -> FreeF f a a0 Source #

Generic1 (CofreeF f a :: Type -> Type) 
Instance details

Defined in Control.Comonad.Trans.Cofree

Associated Types

type Rep1 (CofreeF f a) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). CofreeF f a a0 -> Rep1 (CofreeF f a) a0 Source #

to1 :: forall (a0 :: k). Rep1 (CofreeF f a) a0 -> CofreeF f a a0 Source #

Generic1 (Tagged s :: Type -> Type) 
Instance details

Defined in Data.Tagged

Associated Types

type Rep1 (Tagged s) :: k -> Type Source #

Methods

from1 :: forall (a :: k). Tagged s a -> Rep1 (Tagged s) a Source #

to1 :: forall (a :: k). Rep1 (Tagged s) a -> Tagged s a Source #

Generic1 ((,,,) a b c :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ((,,,) a b c) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). (a, b, c, a0) -> Rep1 ((,,,) a b c) a0 Source #

to1 :: forall (a0 :: k). Rep1 ((,,,) a b c) a0 -> (a, b, c, a0) Source #

Generic1 ((,,,,) a b c d :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ((,,,,) a b c d) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). (a, b, c, d, a0) -> Rep1 ((,,,,) a b c d) a0 Source #

to1 :: forall (a0 :: k). Rep1 ((,,,,) a b c d) a0 -> (a, b, c, d, a0) Source #

Generic1 ((,,,,,) a b c d e :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ((,,,,,) a b c d e) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). (a, b, c, d, e, a0) -> Rep1 ((,,,,,) a b c d e) a0 Source #

to1 :: forall (a0 :: k). Rep1 ((,,,,,) a b c d e) a0 -> (a, b, c, d, e, a0) Source #

Generic1 ((,,,,,,) a b c d e f :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ((,,,,,,) a b c d e f) :: k -> Type Source #

Methods

from1 :: forall (a0 :: k). (a, b, c, d, e, f, a0) -> Rep1 ((,,,,,,) a b c d e f) a0 Source #

to1 :: forall (a0 :: k). Rep1 ((,,,,,,) a b c d e f) a0 -> (a, b, c, d, e, f, a0) Source #

Type-level natural numbers

Type-level strings

Template Haskell

class Lift (t :: TYPE r) where Source #

A Lift instance can have any of its values turned into a Template Haskell expression. This is needed when a value used within a Template Haskell quotation is bound outside the Oxford brackets ([| ... |] or [|| ... ||]) but not at the top level. As an example:

add1 :: Int -> Q (TExp Int)
add1 x = [|| x + 1 ||]

Template Haskell has no way of knowing what value x will take on at splice-time, so it requires the type of x to be an instance of Lift.

A Lift instance must satisfy $(lift x) ≡ x and $$(liftTyped x) ≡ x for all x, where $(...) and $$(...) are Template Haskell splices. It is additionally expected that lift x ≡ unTypeQ (liftTyped x).

Lift instances can be derived automatically by use of the -XDeriveLift GHC language extension:

{-# LANGUAGE DeriveLift #-}
module Foo where

import Language.Haskell.TH.Syntax

data Bar a = Bar1 a (Bar a) | Bar2 String
  deriving Lift

Levity-polymorphic since template-haskell-2.16.0.0.

Minimal complete definition

liftTyped

Methods

lift :: t -> Q Exp Source #

Turn a value into a Template Haskell expression, suitable for use in a splice.

liftTyped :: t -> Q (TExp t) Source #

Turn a value into a Template Haskell typed expression, suitable for use in a typed splice.

Since: template-haskell-2.16.0.0

Instances

Instances details
Lift Bool 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Bool -> Q Exp Source #

liftTyped :: Bool -> Q (TExp Bool) Source #

Lift Char 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Char -> Q Exp Source #

liftTyped :: Char -> Q (TExp Char) Source #

Lift Double 
Instance details

Defined in Language.Haskell.TH.Syntax

Lift Float 
Instance details

Defined in Language.Haskell.TH.Syntax

Lift Int 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Int -> Q Exp Source #

liftTyped :: Int -> Q (TExp Int) Source #

Lift Int8 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Int8 -> Q Exp Source #

liftTyped :: Int8 -> Q (TExp Int8) Source #

Lift Int16 
Instance details

Defined in Language.Haskell.TH.Syntax

Lift Int32 
Instance details

Defined in Language.Haskell.TH.Syntax

Lift Int64 
Instance details

Defined in Language.Haskell.TH.Syntax

Lift Integer 
Instance details

Defined in Language.Haskell.TH.Syntax

Lift Natural 
Instance details

Defined in Language.Haskell.TH.Syntax

Lift Word 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Word -> Q Exp Source #

liftTyped :: Word -> Q (TExp Word) Source #

Lift Word8 
Instance details

Defined in Language.Haskell.TH.Syntax

Lift Word16 
Instance details

Defined in Language.Haskell.TH.Syntax

Lift Word32 
Instance details

Defined in Language.Haskell.TH.Syntax

Lift Word64 
Instance details

Defined in Language.Haskell.TH.Syntax

Lift () 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: () -> Q Exp Source #

liftTyped :: () -> Q (TExp ()) Source #

Lift Void

Since: template-haskell-2.15.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Void -> Q Exp Source #

liftTyped :: Void -> Q (TExp Void) Source #

Lift ByteArray 
Instance details

Defined in Data.Array.Byte

Lift Half 
Instance details

Defined in Numeric.Half.Internal

Methods

lift :: Half -> Q Exp Source #

liftTyped :: Half -> Q (TExp Half) Source #

Lift Specificity 
Instance details

Defined in Language.Haskell.TH.Datatype.TyVarBndr

Lift ConstrRepr Source # 
Instance details

Defined in Clash.Annotations.BitRepresentation

Lift DataReprAnn Source # 
Instance details

Defined in Clash.Annotations.BitRepresentation

Lift Bit Source # 
Instance details

Defined in Clash.Sized.Internal.BitVector

Methods

lift :: Bit -> Q Exp Source #

liftTyped :: Bit -> Q (TExp Bit) Source #

Lift Femtoseconds Source # 
Instance details

Defined in Clash.Signal.Internal

Lift PortName Source # 
Instance details

Defined in Clash.Annotations.TopEntity

Lift TopEntity Source # 
Instance details

Defined in Clash.Annotations.TopEntity

Lift Int#

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Int# -> Q Exp Source #

liftTyped :: Int# -> Q (TExp Int#) Source #

Lift Char#

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Lift Word#

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Lift Addr#

Produces an Addr# literal from the NUL-terminated C-string starting at the given memory address.

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Lift Float#

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Lift Double#

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Lift a => Lift ([a] :: Type) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: [a] -> Q Exp Source #

liftTyped :: [a] -> Q (TExp [a]) Source #

Lift a => Lift (Maybe a :: Type) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Maybe a -> Q Exp Source #

liftTyped :: Maybe a -> Q (TExp (Maybe a)) Source #

Integral a => Lift (Ratio a :: Type) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Ratio a -> Q Exp Source #

liftTyped :: Ratio a -> Q (TExp (Ratio a)) Source #

Lift a => Lift (NonEmpty a :: Type)

Since: template-haskell-2.15.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: NonEmpty a -> Q Exp Source #

liftTyped :: NonEmpty a -> Q (TExp (NonEmpty a)) Source #

Lift a => Lift (HashSet a :: Type)

Since: unordered-containers-0.2.17.0

Instance details

Defined in Data.HashSet.Internal

Methods

lift :: HashSet a -> Q Exp Source #

liftTyped :: HashSet a -> Q (TExp (HashSet a)) Source #

Lift (PrimArray a :: Type) 
Instance details

Defined in Data.Primitive.PrimArray

Lift a => Lift (SmallArray a :: Type) 
Instance details

Defined in Data.Primitive.SmallArray

Lift a => Lift (Array a :: Type) 
Instance details

Defined in Data.Primitive.Array

Methods

lift :: Array a -> Q Exp Source #

liftTyped :: Array a -> Q (TExp (Array a)) Source #

KnownSymbol s => Lift (SSymbol s :: Type) Source # 
Instance details

Defined in Clash.Promoted.Symbol

Methods

lift :: SSymbol s -> Q Exp Source #

liftTyped :: SSymbol s -> Q (TExp (SSymbol s)) Source #

KnownNat n => Lift (BitVector n :: Type) Source # 
Instance details

Defined in Clash.Sized.Internal.BitVector

KnownNat n => Lift (Index n :: Type) Source # 
Instance details

Defined in Clash.Sized.Internal.Index

Methods

lift :: Index n -> Q Exp Source #

liftTyped :: Index n -> Q (TExp (Index n)) Source #

Lift (SNat n :: Type) Source # 
Instance details

Defined in Clash.Promoted.Nat

Methods

lift :: SNat n -> Q Exp Source #

liftTyped :: SNat n -> Q (TExp (SNat n)) Source #

KnownNat n => Lift (Unsigned n :: Type) Source # 
Instance details

Defined in Clash.Sized.Internal.Unsigned

Methods

lift :: Unsigned n -> Q Exp Source #

liftTyped :: Unsigned n -> Q (TExp (Unsigned n)) Source #

KnownNat n => Lift (Signed n :: Type) Source # 
Instance details

Defined in Clash.Sized.Internal.Signed

Methods

lift :: Signed n -> Q Exp Source #

liftTyped :: Signed n -> Q (TExp (Signed n)) Source #

Lift a => Lift (Attr a :: Type) Source # 
Instance details

Defined in Clash.Annotations.SynthesisAttributes

Methods

lift :: Attr a -> Q Exp Source #

liftTyped :: Attr a -> Q (TExp (Attr a)) Source #

(Lift a, Lift b) => Lift (Either a b :: Type) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Either a b -> Q Exp Source #

liftTyped :: Either a b -> Q (TExp (Either a b)) Source #

(Lift a, Lift b) => Lift ((a, b) :: Type) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (a, b) -> Q Exp Source #

liftTyped :: (a, b) -> Q (TExp (a, b)) Source #

(Lift k, Lift v) => Lift (HashMap k v :: Type)

Since: unordered-containers-0.2.17.0

Instance details

Defined in Data.HashMap.Internal

Methods

lift :: HashMap k v -> Q Exp Source #

liftTyped :: HashMap k v -> Q (TExp (HashMap k v)) Source #

(Lift k, Lift v) => Lift (Leaf k v :: Type)

Since: unordered-containers-0.2.17.0

Instance details

Defined in Data.HashMap.Internal

Methods

lift :: Leaf k v -> Q Exp Source #

liftTyped :: Leaf k v -> Q (TExp (Leaf k v)) Source #

Lift a => Lift (Vec n a :: Type) Source # 
Instance details

Defined in Clash.Sized.Vector

Methods

lift :: Vec n a -> Q Exp Source #

liftTyped :: Vec n a -> Q (TExp (Vec n a)) Source #

Lift a => Lift (Signal dom a :: Type) Source # 
Instance details

Defined in Clash.Signal.Internal

Methods

lift :: Signal dom a -> Q Exp Source #

liftTyped :: Signal dom a -> Q (TExp (Signal dom a)) Source #

Lift a => Lift (RTree d a :: Type) Source # 
Instance details

Defined in Clash.Sized.RTree

Methods

lift :: RTree d a -> Q Exp Source #

liftTyped :: RTree d a -> Q (TExp (RTree d a)) Source #

(Lift a, Lift b, Lift c) => Lift ((a, b, c) :: Type) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (a, b, c) -> Q Exp Source #

liftTyped :: (a, b, c) -> Q (TExp (a, b, c)) Source #

Lift a => Lift (DSignal dom delay a :: Type) Source # 
Instance details

Defined in Clash.Signal.Delayed.Internal

Methods

lift :: DSignal dom delay a -> Q Exp Source #

liftTyped :: DSignal dom delay a -> Q (TExp (DSignal dom delay a)) Source #

(Lift (rep (int + frac)), KnownNat frac, KnownNat int, Typeable rep) => Lift (Fixed rep int frac :: Type) Source # 
Instance details

Defined in Clash.Sized.Fixed

Methods

lift :: Fixed rep int frac -> Q Exp Source #

liftTyped :: Fixed rep int frac -> Q (TExp (Fixed rep int frac)) Source #

(Lift a, Lift b, Lift c, Lift d) => Lift ((a, b, c, d) :: Type) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (a, b, c, d) -> Q Exp Source #

liftTyped :: (a, b, c, d) -> Q (TExp (a, b, c, d)) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e) => Lift ((a, b, c, d, e) :: Type) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (a, b, c, d, e) -> Q Exp Source #

liftTyped :: (a, b, c, d, e) -> Q (TExp (a, b, c, d, e)) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f) => Lift ((a, b, c, d, e, f) :: Type) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (a, b, c, d, e, f) -> Q Exp Source #

liftTyped :: (a, b, c, d, e, f) -> Q (TExp (a, b, c, d, e, f)) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f, Lift g) => Lift ((a, b, c, d, e, f, g) :: Type) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (a, b, c, d, e, f, g) -> Q Exp Source #

liftTyped :: (a, b, c, d, e, f, g) -> Q (TExp (a, b, c, d, e, f, g)) Source #

Lift (# #)

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# #) -> Q Exp Source #

liftTyped :: (# #) -> Q (TExp (# #)) Source #

Lift a => Lift ((# a #) :: TYPE ('TupleRep '['LiftedRep]))

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# a #) -> Q Exp Source #

liftTyped :: (# a #) -> Q (TExp (# a #)) Source #

(Lift a, Lift b) => Lift ((# a, b #) :: TYPE ('TupleRep '['LiftedRep, 'LiftedRep]))

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# a, b #) -> Q Exp Source #

liftTyped :: (# a, b #) -> Q (TExp (# a, b #)) Source #

(Lift a, Lift b) => Lift ((# a | b #) :: TYPE ('SumRep '['LiftedRep, 'LiftedRep]))

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# a | b #) -> Q Exp Source #

liftTyped :: (# a | b #) -> Q (TExp (# a | b #)) Source #

(Lift a, Lift b, Lift c) => Lift ((# a, b, c #) :: TYPE ('TupleRep '['LiftedRep, 'LiftedRep, 'LiftedRep]))

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# a, b, c #) -> Q Exp Source #

liftTyped :: (# a, b, c #) -> Q (TExp (# a, b, c #)) Source #

(Lift a, Lift b, Lift c) => Lift ((# a | b | c #) :: TYPE ('SumRep '['LiftedRep, 'LiftedRep, 'LiftedRep]))

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# a | b | c #) -> Q Exp Source #

liftTyped :: (# a | b | c #) -> Q (TExp (# a | b | c #)) Source #

(Lift a, Lift b, Lift c, Lift d) => Lift ((# a, b, c, d #) :: TYPE ('TupleRep '['LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep]))

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# a, b, c, d #) -> Q Exp Source #

liftTyped :: (# a, b, c, d #) -> Q (TExp (# a, b, c, d #)) Source #

(Lift a, Lift b, Lift c, Lift d) => Lift ((# a | b | c | d #) :: TYPE ('SumRep '['LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep]))

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# a | b | c | d #) -> Q Exp Source #

liftTyped :: (# a | b | c | d #) -> Q (TExp (# a | b | c | d #)) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e) => Lift ((# a, b, c, d, e #) :: TYPE ('TupleRep '['LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep]))

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# a, b, c, d, e #) -> Q Exp Source #

liftTyped :: (# a, b, c, d, e #) -> Q (TExp (# a, b, c, d, e #)) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e) => Lift ((# a | b | c | d | e #) :: TYPE ('SumRep '['LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep]))

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# a | b | c | d | e #) -> Q Exp Source #

liftTyped :: (# a | b | c | d | e #) -> Q (TExp (# a | b | c | d | e #)) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f) => Lift ((# a, b, c, d, e, f #) :: TYPE ('TupleRep '['LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep]))

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# a, b, c, d, e, f #) -> Q Exp Source #

liftTyped :: (# a, b, c, d, e, f #) -> Q (TExp (# a, b, c, d, e, f #)) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f) => Lift ((# a | b | c | d | e | f #) :: TYPE ('SumRep '['LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep]))

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# a | b | c | d | e | f #) -> Q Exp Source #

liftTyped :: (# a | b | c | d | e | f #) -> Q (TExp (# a | b | c | d | e | f #)) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f, Lift g) => Lift ((# a, b, c, d, e, f, g #) :: TYPE ('TupleRep '['LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep]))

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# a, b, c, d, e, f, g #) -> Q Exp Source #

liftTyped :: (# a, b, c, d, e, f, g #) -> Q (TExp (# a, b, c, d, e, f, g #)) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f, Lift g) => Lift ((# a | b | c | d | e | f | g #) :: TYPE ('SumRep '['LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep, 'LiftedRep]))

Since: template-haskell-2.16.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: (# a | b | c | d | e | f | g #) -> Q Exp Source #

liftTyped :: (# a | b | c | d | e | f | g #) -> Q (TExp (# a | b | c | d | e | f | g #)) Source #

Type classes

Clash

Other

module Data.Bits

Exceptions

Named types

Magic

Haskell Prelude

Clash.Explicit.Prelude re-exports most of the Haskell Prelude with the exception of those functions that the Clash API defines to work on Vec from Clash.Sized.Vector instead of on lists as the Haskell Prelude does. In addition, for the odd and even functions a type class called Parity is available at Clash.Class.Parity.