คำถามติดแท็ก 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 …
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.