]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/RealFunction.hs
src/{Cube,FunctionValues}.hs: add explicit Cardinal imports.
[spline3.git] / src / RealFunction.hs
index 01e34bdf39d086e7dbced9690ba6c7a891cda844..37babf6b7fc351c1ac6621b2eaa4ce0e8962b056 100644 (file)
@@ -1,13 +1,15 @@
+{-# OPTIONS_GHC -Wno-orphans #-}
 {-# LANGUAGE FlexibleInstances #-}
 
 module RealFunction (
   RealFunction,
   cmult,
-  fexp
-  )
+  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,5 +73,5 @@ cmult coeff f = (*coeff) . f
 --
 fexp :: (RealFunction a) -> Int -> (RealFunction a)
 fexp f n
-     | n == 0 = (\_ -> 1)
+     | n == 0 = const 1
      | otherwise = \x -> (f x)^n