From 7124a4f00e536b4d5323a7488c1f65469dddb102 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 12 May 2020 12:21:36 +0100 Subject: Format with ormolu --- src/Verismith/Circuit/Base.hs | 51 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 26 deletions(-) (limited to 'src/Verismith/Circuit/Base.hs') diff --git a/src/Verismith/Circuit/Base.hs b/src/Verismith/Circuit/Base.hs index 9a5ab34..804fbfd 100644 --- a/src/Verismith/Circuit/Base.hs +++ b/src/Verismith/Circuit/Base.hs @@ -1,40 +1,39 @@ -{-| -Module : Verismith.Circuit.Base -Description : Base types for the circuit module. -Copyright : (c) 2019, Yann Herklotz Grave -License : GPL-3 -Maintainer : yann [at] yannherklotz [dot] com -Stability : experimental -Portability : POSIX - -Base types for the circuit module. --} - +-- | +-- Module : Verismith.Circuit.Base +-- Description : Base types for the circuit module. +-- Copyright : (c) 2019, Yann Herklotz Grave +-- License : GPL-3 +-- Maintainer : yann [at] yannherklotz [dot] com +-- Stability : experimental +-- Portability : POSIX +-- +-- Base types for the circuit module. module Verismith.Circuit.Base - ( Gate(..) - , Circuit(..) - , CNode(..) - , CEdge(..) - ) + ( Gate (..), + Circuit (..), + CNode (..), + CEdge (..), + ) where -import Data.Graph.Inductive (Gr, LEdge, LNode) -import System.Random +import Data.Graph.Inductive (Gr, LEdge, LNode) +import System.Random -- | The types for all the gates. -data Gate = And - | Or - | Xor - deriving (Show, Eq, Enum, Bounded, Ord) +data Gate + = And + | Or + | Xor + deriving (Show, Eq, Enum, Bounded, Ord) -- | Newtype for the Circuit which implements a Graph from fgl. -newtype Circuit = Circuit { getCircuit :: Gr Gate () } +newtype Circuit = Circuit {getCircuit :: Gr Gate ()} -- | Newtype for a node in the circuit, which is an 'LNode Gate'. -newtype CNode = CNode { getCNode :: LNode Gate } +newtype CNode = CNode {getCNode :: LNode Gate} -- | Newtype for a named edge which is empty, as it does not need a label. -newtype CEdge = CEdge { getCEdge :: LEdge () } +newtype CEdge = CEdge {getCEdge :: LEdge ()} instance Random Gate where randomR (a, b) g = -- cgit