VH-NVK
typically on squawk code 0042
It is a Eurocopter BO-105.
using System; | |
namespace PureIO { | |
/* | |
C# does not have proper sum types. They must be emulated. | |
This data type is one of 4 possible values: | |
- WriteOut, being a pair of a string and A | |
- WriteErr, being a pair of a string and A | |
- readLine, being a function from string to A |
skipRight :: | |
(a -> [a] -> ([a] -> b) -> b) | |
-> b | |
-> [a] | |
-> b | |
skipRight _ z [] = | |
z | |
skipRight f z (h:t) = | |
f h t (skipRight f z) |
import Control.Applicative(Alternative(..), liftA2) | |
newtype ValidationT f a b = | |
ValidationT (f (Either a b)) | |
instance Functor f => Functor (ValidationT f a) where | |
fmap f (ValidationT x) = | |
ValidationT (fmap (fmap f) x) | |
instance Applicative f => Applicative (ValidationT f a) where |
#!/usr/bin/env runhaskell | |
module Main where | |
import Text.Printf(printf) | |
import Data.List(intercalate) | |
import Data.Bool (bool) | |
kg2lb = | |
(*2.2) |
import Data.Monoid | |
-- This code doesn't work... | |
-- How can you make a multi-parameter data type be Foldable? | |
-- foldMap over `a` so it can be converted to a Monoid | |
data BinaryTree3 a v | |
= Node3 a (BinaryTree3 a v) (BinaryTree3 a v) | |
| Leaf3 a v | |
deriving (Show) |
#!/usr/bin/env runhaskell | |
import Text.Printf | |
fromRadian a = a / pi * 180 | |
toRadian a = a / 180 * pi | |
showDiff :: Int -> String | |
showDiff x = | |
let x' = toRadian (fromIntegral x) | |
diff = fromRadian (x' - sin x') |
#!/usr/bin/env runhaskell | |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE DeriveFoldable #-} | |
import Data.Foldable | |
import Text.Printf | |
data Point a = | |
Point { |