]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/RealFunction.hs
spline3.cabal: bump version to 1.0.2
[spline3.git] / src / RealFunction.hs
index 307a0f0c5cb9596a58d8c6375ee9b06fbd79266c..f6d0482633ea14dd3c5059b99dc79fd4ed50abd5 100644 (file)
@@ -1,3 +1,4 @@
+{-# OPTIONS_GHC -Wno-orphans #-}
 {-# LANGUAGE FlexibleInstances #-}
 
 module RealFunction (
@@ -6,7 +7,9 @@ module RealFunction (
   fexp )
 where
 
-
+-- Presumably this is faster without a newtype wrapper, and that's why
+-- we're about to define a bunch of orphan instances below. Note the
+-- GHC pragma thingy at the top of this file to ignore those warnings.
 type RealFunction a = (a -> Double)
 
 
@@ -71,4 +74,4 @@ cmult coeff f = (*coeff) . f
 fexp :: (RealFunction a) -> Int -> (RealFunction a)
 fexp f n
      | n == 0 = const 1
-     | otherwise = \x -> (f x)^n
+     | otherwise = \x -> (f x) ^ n