File: PreRequisites.hs

package info (click to toggle)
haskell-numinstances 1.4-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 88 kB
  • sloc: haskell: 255; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 482 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Data.NumInstances.PreRequisites where

import Control.Applicative

import Data.NumInstances.Util

noFun :: String -> a
noFun = noOv "function"

-- Eq & Show are prerequisites for Num, so they need to be faked here
instance Eq (a->b) where
  (==) = noFun "(==)"
  (/=) = noFun "(/=)"

instance Ord b => Ord (a->b) where
  min = liftA2 min
  max = liftA2 max

instance Show (a->b) where
  show      = noFun "show"
  showsPrec = noFun "showsPrec"
  showList  = noFun "showList"