Skip to content

Instantly share code, notes, and snippets.

@bavardage
Created May 26, 2009 20:13
Show Gist options
  • Save bavardage/118264 to your computer and use it in GitHub Desktop.
Save bavardage/118264 to your computer and use it in GitHub Desktop.
sumseries f a b = sum[f n|n<-[a..b]]
data Σ a = Σ (a -> a) a a
instance (Show a, Num a, Enum a) => Show (Σ a) where
show (Σ f a b) = show $ sumseries f a b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment