{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

-- | The Binaryen index type.
--
-- See <https://github.com/WebAssembly/binaryen/blob/master/src/binaryen-c.h>
-- for API documentation.
--
-- This module is intended to be imported qualified.
module Binaryen.Index where

import Data.Word (Word32)
import Foreign (Storable)

newtype Index = Index Word32
  deriving newtype
    ( Int -> Index
Index -> Int
Index -> [Index]
Index -> Index
Index -> Index -> [Index]
Index -> Index -> Index -> [Index]
(Index -> Index)
-> (Index -> Index)
-> (Int -> Index)
-> (Index -> Int)
-> (Index -> [Index])
-> (Index -> Index -> [Index])
-> (Index -> Index -> [Index])
-> (Index -> Index -> Index -> [Index])
-> Enum Index
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: Index -> Index -> Index -> [Index]
$cenumFromThenTo :: Index -> Index -> Index -> [Index]
enumFromTo :: Index -> Index -> [Index]
$cenumFromTo :: Index -> Index -> [Index]
enumFromThen :: Index -> Index -> [Index]
$cenumFromThen :: Index -> Index -> [Index]
enumFrom :: Index -> [Index]
$cenumFrom :: Index -> [Index]
fromEnum :: Index -> Int
$cfromEnum :: Index -> Int
toEnum :: Int -> Index
$ctoEnum :: Int -> Index
pred :: Index -> Index
$cpred :: Index -> Index
succ :: Index -> Index
$csucc :: Index -> Index
Enum,
      Index -> Index -> Bool
(Index -> Index -> Bool) -> (Index -> Index -> Bool) -> Eq Index
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Index -> Index -> Bool
$c/= :: Index -> Index -> Bool
== :: Index -> Index -> Bool
$c== :: Index -> Index -> Bool
Eq,
      Enum Index
Real Index
Real Index
-> Enum Index
-> (Index -> Index -> Index)
-> (Index -> Index -> Index)
-> (Index -> Index -> Index)
-> (Index -> Index -> Index)
-> (Index -> Index -> (Index, Index))
-> (Index -> Index -> (Index, Index))
-> (Index -> Integer)
-> Integral Index
Index -> Integer
Index -> Index -> (Index, Index)
Index -> Index -> Index
forall a.
Real a
-> Enum a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> (a, a))
-> (a -> a -> (a, a))
-> (a -> Integer)
-> Integral a
toInteger :: Index -> Integer
$ctoInteger :: Index -> Integer
divMod :: Index -> Index -> (Index, Index)
$cdivMod :: Index -> Index -> (Index, Index)
quotRem :: Index -> Index -> (Index, Index)
$cquotRem :: Index -> Index -> (Index, Index)
mod :: Index -> Index -> Index
$cmod :: Index -> Index -> Index
div :: Index -> Index -> Index
$cdiv :: Index -> Index -> Index
rem :: Index -> Index -> Index
$crem :: Index -> Index -> Index
quot :: Index -> Index -> Index
$cquot :: Index -> Index -> Index
$cp2Integral :: Enum Index
$cp1Integral :: Real Index
Integral,
      Integer -> Index
Index -> Index
Index -> Index -> Index
(Index -> Index -> Index)
-> (Index -> Index -> Index)
-> (Index -> Index -> Index)
-> (Index -> Index)
-> (Index -> Index)
-> (Index -> Index)
-> (Integer -> Index)
-> Num Index
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> Index
$cfromInteger :: Integer -> Index
signum :: Index -> Index
$csignum :: Index -> Index
abs :: Index -> Index
$cabs :: Index -> Index
negate :: Index -> Index
$cnegate :: Index -> Index
* :: Index -> Index -> Index
$c* :: Index -> Index -> Index
- :: Index -> Index -> Index
$c- :: Index -> Index -> Index
+ :: Index -> Index -> Index
$c+ :: Index -> Index -> Index
Num,
      Eq Index
Eq Index
-> (Index -> Index -> Ordering)
-> (Index -> Index -> Bool)
-> (Index -> Index -> Bool)
-> (Index -> Index -> Bool)
-> (Index -> Index -> Bool)
-> (Index -> Index -> Index)
-> (Index -> Index -> Index)
-> Ord Index
Index -> Index -> Bool
Index -> Index -> Ordering
Index -> Index -> Index
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Index -> Index -> Index
$cmin :: Index -> Index -> Index
max :: Index -> Index -> Index
$cmax :: Index -> Index -> Index
>= :: Index -> Index -> Bool
$c>= :: Index -> Index -> Bool
> :: Index -> Index -> Bool
$c> :: Index -> Index -> Bool
<= :: Index -> Index -> Bool
$c<= :: Index -> Index -> Bool
< :: Index -> Index -> Bool
$c< :: Index -> Index -> Bool
compare :: Index -> Index -> Ordering
$ccompare :: Index -> Index -> Ordering
$cp1Ord :: Eq Index
Ord,
      Num Index
Ord Index
Num Index -> Ord Index -> (Index -> Rational) -> Real Index
Index -> Rational
forall a. Num a -> Ord a -> (a -> Rational) -> Real a
toRational :: Index -> Rational
$ctoRational :: Index -> Rational
$cp2Real :: Ord Index
$cp1Real :: Num Index
Real,
      Int -> Index -> ShowS
[Index] -> ShowS
Index -> String
(Int -> Index -> ShowS)
-> (Index -> String) -> ([Index] -> ShowS) -> Show Index
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Index] -> ShowS
$cshowList :: [Index] -> ShowS
show :: Index -> String
$cshow :: Index -> String
showsPrec :: Int -> Index -> ShowS
$cshowsPrec :: Int -> Index -> ShowS
Show,
      Ptr b -> Int -> IO Index
Ptr b -> Int -> Index -> IO ()
Ptr Index -> IO Index
Ptr Index -> Int -> IO Index
Ptr Index -> Int -> Index -> IO ()
Ptr Index -> Index -> IO ()
Index -> Int
(Index -> Int)
-> (Index -> Int)
-> (Ptr Index -> Int -> IO Index)
-> (Ptr Index -> Int -> Index -> IO ())
-> (forall b. Ptr b -> Int -> IO Index)
-> (forall b. Ptr b -> Int -> Index -> IO ())
-> (Ptr Index -> IO Index)
-> (Ptr Index -> Index -> IO ())
-> Storable Index
forall b. Ptr b -> Int -> IO Index
forall b. Ptr b -> Int -> Index -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr Index -> Index -> IO ()
$cpoke :: Ptr Index -> Index -> IO ()
peek :: Ptr Index -> IO Index
$cpeek :: Ptr Index -> IO Index
pokeByteOff :: Ptr b -> Int -> Index -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> Index -> IO ()
peekByteOff :: Ptr b -> Int -> IO Index
$cpeekByteOff :: forall b. Ptr b -> Int -> IO Index
pokeElemOff :: Ptr Index -> Int -> Index -> IO ()
$cpokeElemOff :: Ptr Index -> Int -> Index -> IO ()
peekElemOff :: Ptr Index -> Int -> IO Index
$cpeekElemOff :: Ptr Index -> Int -> IO Index
alignment :: Index -> Int
$calignment :: Index -> Int
sizeOf :: Index -> Int
$csizeOf :: Index -> Int
Storable
    )