Skip to content

clashi make always loads Clash.Prelude #811

Closed
@leonschoorl

Description

@leonschoorl

The current clashi always loads the module Clash.Prelude.
This makes experimenting with functions from Clash.Explicit.Prelude annoying.

Given Test.hs:

module Test where
import Clash.Explicit.Prelude

topEntity = register

Loading this in clashi-0.99.3 brings the exports of Clash.Explicit.Prelude in scope inside clashi:

CLaSHi, version 0.99.3 (using clash-lib, version 0.99.3):
[1 of 1] Compiling Test         ( Test.hs, interpreted )
Ok, one module loaded.
*Test> :t register
register
  :: Clock domain gated
     -> Reset domain synchronous
     -> a
     -> Signal domain a
     -> Signal domain a
*Test> :t topEntity 
topEntity
  :: Clock domain gated
     -> Reset domain synchronous
     -> a
     -> Signal domain a
     -> Signal domain a
*Test> 

But the current master keeps Clash.Prelude in scope:

Clashi, version 1.1.0 (using clash-lib, version 1.1.0):
[1 of 1] Compiling Test         ( Test.hs, Test.o )
Ok, one module loaded.
Clash.Prelude Test> :t register
register
  :: (KnownDomain dom,
      GHC.Classes.IP (AppendSymbol dom "_clk") (Clock dom),
      GHC.Classes.IP (AppendSymbol dom "_rst") (Reset dom),
      GHC.Classes.IP (AppendSymbol dom "_en") (Enable dom), NFDataX a) =>
     a -> Signal dom a -> Signal dom a
Clash.Prelude Test> :t topEntity 
topEntity
  :: (KnownDomain dom, NFDataX a) =>
     Clock dom
     -> Reset dom -> Enable dom -> a -> Signal dom a -> Signal dom a
Clash.Prelude Test> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions