blob: f3b7b6adecb05c4a9f6fd842607a0f5ead5b975b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -O -Wno-inline-rule-shadowing #-}
-- Rules are ignored without -O
module Orphans where
import GHC.Exts (IsList(..))
-- Some orphan things
instance IsList Bool where
type Item Bool = Double
fromList = undefined
toList = undefined
{-# RULES "myrule1" id id = id #-}
-- And some non-orphan things
data X = X [Int]
instance IsList X where
type Item X = Int
fromList = undefined
toList = undefined
f :: X -> X
f x = x
{-# RULES "myrule2" id f = f #-}
|