This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
module Main where | |
---- | |
-- Coyoneda | |
data CoYoneda f x = forall b. CoYoneda (b -> x) (f b) | |
instance Functor (CoYoneda f) where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysort2 :: [Int] -> [Int] | |
mysort2 [] = [] | |
mysort2 (first : rest) = insert (mysort2 rest) first | |
where | |
insert [] n = [n] | |
insert (first : rest) n | |
| first < n = first : insert rest n | |
| otherwise = n : first : rest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Applicative | |
import Data.Word | |
import System.Environment | |
import Text.Trifecta | |
import Control.Monad | |
import qualified Data.ByteString as BS | |
import qualified Data.ByteString.Lazy as BL | |
import qualified Codec.Binary.UTF8.String as UTF8 | |
infixl 9 :$ |