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 GHC2021 #-} | |
{-# LANGUAGE ImportQualifiedPost #-} | |
{-# LANGUAGE LexicalNegation #-} | |
{-# LANGUAGE LambdaCase, MultiWayIf #-} | |
{-# LANGUAGE NPlusKPatterns #-} | |
{-# LANGUAGE DataKinds, PolyKinds, NoStarIsType, TypeFamilyDependencies #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE OverloadedRecordDot, NoFieldSelectors, DuplicateRecordFields #-} | |
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 GHC2021 #-} | |
module Main where | |
import Data.Char | |
import System.Environment | |
import System.Random.Shuffle | |
main :: IO () | |
main = do | |
{ args <- getArgs |
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
module BorderedMatrix where | |
import Data.Array | |
import Data.List | |
{- | | |
>>> mapM_ print sample | |
[1,2,3] | |
[4,5,6] | |
>>> mapM_ print (borderedMatrix 0 sample) |
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 GHC2021 #-} | |
{-# LANGUAGE ImportQualifiedPost #-} | |
{-# LANGUAGE LexicalNegation #-} | |
{-# LANGUAGE LambdaCase, MultiWayIf #-} | |
{-# LANGUAGE NPlusKPatterns #-} | |
{-# LANGUAGE NoStarIsType, TypeFamilyDependencies, TypeInType #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE OverloadedRecordDot, NoFieldSelectors, DuplicateRecordFields #-} | |
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
# This file was automatically generated by 'stack init' | |
# | |
# Some commonly used options have been documented as comments in this file. | |
# For advanced use and comprehensive documentation of the format, please see: | |
# https://docs.haskellstack.org/en/stable/yaml_configuration/ | |
# Resolver to choose a 'specific' stackage snapshot or a compiler version. | |
# A snapshot resolver dictates the compiler version and the set of packages | |
# to be used for project dependencies. For example: | |
# |
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
.stack-work/ | |
dist-new/ | |
dist-newstyle/ | |
misc.cabal | |
*.log | |
core | |
*.hi | |
*.o | |
*~ |
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
module Main where | |
import System.Environment | |
import System.IO | |
main :: IO () | |
main = do | |
{ putStrLn =<< getProgName | |
; putStr "stdin : "; print =<< hGetBuffering stdin | |
; putStr "stdout: "; print =<< hGetBuffering stdout |
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
module Numeronym where | |
import Control.Arrow ( Arrow((&&&)) ) | |
import Data.Char ( isAscii, isLower ) | |
import Data.Function ( on ) | |
import Data.List ( groupBy, isSuffixOf, sortBy ) | |
import Data.Ord ( comparing ) | |
numeronym :: String -> String | |
numeronym s = take 1 s ++ show n ++ drop (n+1) s |
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
module CountInversion where | |
import Control.Arrow | |
type Count = Int | |
type Size = Int | |
{- | | |
>>> countInversion [19,11,10,7,8,9,17,18,20,4,3,15,16,1,5,14,6,2,13,12] | |
114 | |
-} |
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 GHC2021 #-} | |
module Main where | |
import Data.Char ( isDigit ) | |
import Data.Maybe ( mapMaybe ) | |
main :: IO () | |
main = interact (drive repl) | |
drive :: ([String] -> [String]) -> (String -> String) |
NewerOlder