X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FRealFunction.hs;h=f6d0482633ea14dd3c5059b99dc79fd4ed50abd5;hb=0696fc4f3e428d2156f0be4ca40728abf2e35abe;hp=307a0f0c5cb9596a58d8c6375ee9b06fbd79266c;hpb=2ff335e99a1e12628b87037e08740fbb241413a6;p=spline3.git diff --git a/src/RealFunction.hs b/src/RealFunction.hs index 307a0f0..f6d0482 100644 --- a/src/RealFunction.hs +++ b/src/RealFunction.hs @@ -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