import Clash.Prelude -- import Clash.Explicit.Testbench data SList a = SNil | SCons !a !(SList a) deriving (NFDataX, Generic) isSNil :: SList a -> Bool isSNil sl = case sl of SNil -> True _ -> False tf :: SList Int -> Int -> (SList Int, Maybe Bool) tf s inp = case s of SCons _ s' -> (s', Just False) SNil -> (SNil, Just True) mon :: SystemClockResetEnable => Signal System Int -> Signal System (Maybe Bool) mon = mealy tf SNil topEntity :: Clock System -> Reset System -> Enable System -> Signal System Int -> Signal System (Maybe Bool) topEntity = exposeClockResetEnable mon {- GHC: Setting up GHC took: 0.662s GHC: Compiling and loading modules took: 1.062s Clash: Parsing and compiling primitives took 0.176s GHC+Clash: Loading modules cumulatively took 2.192s Clash: Compiling Main.topEntity Clash.Normalize.Transformations.Inline(523): InlineNonRep: c$Main.mon_ds[19] already inlined 20 times in: Main.mon[8214565720323816306] . The type of the subject is: GHC.Tuple.(,)[3746994889972252676] (Main.SList[8214565720323816301] GHC.Types.Int[3674937295934324766]) (GHC.Maybe.Maybe[3674937295934324792] GHC.Types.Bool[3674937295934324744]) Function Main.mon[8214565720323816306] will not reach a normal form and compilation might fail. Run with '-fclash-inline-limit=N' to increase the inline limit to N. Clash.Normalize.Transformations.Inline(523): InlineNonRep: c$Main.mon_ds[19] already inlined 20 times in: Main.mon[8214565720323816306] . The type of the subject is: GHC.Tuple.(,)[3746994889972252676] (Main.SList[8214565720323816301] GHC.Types.Int[3674937295934324766]) (GHC.Maybe.Maybe[3674937295934324792] GHC.Types.Bool[3674937295934324744]) Function Main.mon[8214565720323816306] will not reach a normal form and compilation might fail. Run with '-fclash-inline-limit=N' to increase the inline limit to N. Clash.Normalize.Transformations.Inline(523): InlineNonRep: c$Main.mon_ds[19] already inlined 20 times in: Main.mon[8214565720323816306] . The type of the subject is: GHC.Tuple.(,)[3746994889972252676] (Main.SList[8214565720323816301] GHC.Types.Int[3674937295934324766]) (GHC.Maybe.Maybe[3674937295934324792] GHC.Types.Bool[3674937295934324744]) Function Main.mon[8214565720323816306] will not reach a normal form and compilation might fail. Run with '-fclash-inline-limit=N' to increase the inline limit to N. : error: Clash error call: Clash.Core.Type(395): Report as bug: not a FunTy CallStack (from HasCallStack): error, called at src/Clash/Core/Type.hs:395:20 in clash-lib-1.6.3-4vM2gwSsWPHufxjlmfu4S:Clash.Core.Type -}