Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (13 sloc) 0.479 kb
> {-# LANGUAGE TemplateHaskell #-}
> {-# LANGUAGE QuasiQuotes #-}
> import Control.Comonad
> import Language.Haskell.Codo
> import Data.Monoid
> instance Monoid Double where
> mempty = 0.0
> mappend = (+)
> differentiate f = ((f 0.001) - f 0) / 0.001
> minima :: (Double -> Double) -> Bool
> minima = [codo| f => f' <- differentiate f
> f'' <- differentiate f'
> (extract f' < 0.001) && (extract f'' > 0) |]
Jump to Line
Something went wrong with that request. Please try again.