Skip to content

Static pointers should work with RebindableSyntax

When RebindableSyntax is enabled, GHC uses functions such as fromInteger, fromString from scope, rather than relying on the typeclasses. This principle is not upheld for fromStaticPtr:

{-# LANGUAGE RebindableSyntax, StaticPointers, NoMonomorphismRestriction #-}
module M where

data T = MkT

fromInteger :: a -> T
fromInteger _ = MkT

fromStaticPtr :: a -> T
fromStaticPtr _ = MkT

x = 0
y = static 'a'

gives

x :: T
y :: GHC.StaticPtr.IsStatic t => t GHC.Types.Char

The type of y should be T, just like x.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information