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 Data.List | |
import Data.Maybe | |
import Data.Char | |
data Person = Person { name :: String, age :: Int } deriving (Show) | |
main :: IO () | |
main = do | |
let pList = [Person "Jack" 11,Person "Bill" 48,Person "Tom" 19,Person "Dane9" 22,Person "Jimmy9" 13] | |
let validatedL = map validatePerson pList |
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 OverloadedStrings #-} | |
import Data.Maybe | |
import qualified Data.Text as T | |
import qualified Data.Text.IO as TIO | |
import Text.Read | |
data Car = Car{year:: Int, mark:: T.Text, model:: T.Text, comment:: T.Text, price:: Float } -- Double | |
-- a b c d e |
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 OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Network.HTTP.Conduit | |
import Network.HTTP.Simple | |
import Control.Monad | |
import qualified Data.ByteString.Lazy.Char8 as L8 | |
import qualified Data.ByteString.Char8 as C | |
import Control.Exception (try) | |
import Control.Concurrent.Async |
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 DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE MonoLocalBinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Main where | |
import System.Console.ANSI |
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 DeriveFunctor #-} | |
import System.Random | |
import Data.List | |
import Data.String | |
import System.Console.ANSI | |
import Control.Monad.Free | |
import Prelude | |
initState = ["0", "1", "2", "3", "4", "5", "6", "7", "8" ] |
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 DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE MonoLocalBinds #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module Main 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
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE DeriveAnyClass #-} | |
import Data.Sequence | |
import Control.Monad | |
import Control.Monad.IO.Class | |
import Control.Applicative | |
import Control.Monad.Trans.Free | |
data ThreadF next = Fork next next |
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 DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE MonoLocalBinds #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE Rank2Types #-} |
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 ScopedTypeVariables #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
data TestItem b n = TestItem {itemName::b, itemValue::n} | |
class (Num n,IsString b) => PieChartItem a b n where | |
getValue :: a -> n | |
getName :: a -> b |
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 OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Data.IORef | |
import Graphics.UI.Gtk | |
import Graphics.UI.Gtk.ModelView | |
import qualified Data.Text as T | |
import Graphics.UI.Gtk.Gdk.Events as Ev | |
import Data.Maybe | |
import System.IO.Unsafe |
OlderNewer