File: Foo.hs

package info (click to toggle)
haskell-doctest-parallel 0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 648 kB
  • sloc: haskell: 3,207; ansic: 4; makefile: 3
file content (8 lines) | stat: -rw-r--r-- 255 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
module Color.Foo where

import Data.Maybe

-- | Convert a map into list array.
-- prop> tabulate m !! fromEnum d == fromMaybe 0 (lookup d m)
tabulate :: [(Bool, Double)] -> [Double]
tabulate m = [fromMaybe 0 $ lookup False m, fromMaybe 0 $ lookup True m]