Questions tagged «phantom-types»

2
现代GHC版本是否具有某种形式的证明擦除?
假设我有一个仅出于类型系统的利益而存在的参数,例如在此小程序中: {-# LANGUAGE GADTs #-} module Main where import Data.Proxy import Data.List data MyPoly where MyConstr :: Proxy a -> a -> (Proxy a -> a -> Int -> Int) -> MyPoly listOfPolys :: [MyPoly] listOfPolys = [MyConstr Proxy 5 (const (+)) , MyConstr Proxy 10 (const (+)) , MyConstr …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.