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
-- rename Project Euler files in git lost-found directory | |
-- get the file type and the problem number from the initial comments | |
-- in each file | |
import System.Directory | |
import Text.Regex.Posix | |
import Control.Monad (forM_) | |
lostFilesDir = ".git/lost-found/other" |
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
-- rename Project Euler files in git lost-found directory | |
-- get the file type and the problem number from the initial comments | |
-- in each file | |
import System.Directory | |
import Text.Regex.Posix | |
import Control.Monad (forM_) | |
lostFilesDir = ".git/lost-found/other" |
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
-- rename Project Euler files in git lost-found directory | |
-- get the file type and the problem number from the initial comments | |
-- in each file | |
import System.Environment | |
import System.Directory | |
import Text.Regex.Posix | |
import Control.Monad (forM_) |
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
-- https://questhub.io/realm/haskell/quest/537bb4e2bbd0bed61d00007d | |
head :: [a] -> a | |
head [] = error "head: empty list" | |
head (x:xs) = x | |
tail :: [a] -> [a] | |
tail [] = error "tail: empty list" | |
tail (x:xs) = xs |
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 System.Environment (getArgs) | |
import Text.Parsec | |
import Text.Parsec.Prim | |
import Text.Parsec.Language | |
import qualified Text.Parsec.Token as T | |
import Control.Applicative ((<$>), (*>)) | |
type Parser = Parsec String () | |
-- AST |
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 System.Environment (getArgs) | |
import Text.Parsec | |
import Text.Parsec.Prim | |
import Text.Parsec.Language | |
import qualified Text.Parsec.Token as T | |
import Control.Applicative ((<$>), (*>), (<*>), pure) | |
type Parser = Parsec String () | |
-- AST |
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 System.Environment (getArgs) | |
import Text.Parsec | |
import Text.Parsec.Prim | |
import Text.Parsec.Language | |
import qualified Text.Parsec.Token as T | |
import Control.Applicative ((<$>), (*>), (<*>), pure, liftA2) | |
type Parser = Parsec String () | |
type Location = String | |
type LocNode a = (Location, a) |
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 System.Environment (getArgs) | |
import Text.Parsec | |
import Text.Parsec.Prim | |
import Text.Parsec.Language | |
import qualified Text.Parsec.Token as T | |
import Control.Applicative ((<$>), (*>), (<*>), pure, liftA2) | |
import Data.List (intercalate) | |
type Parser = Parsec String () | |
type Location = String |
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
### the patch passes the following tests :) | |
#?rakudo todo 'unicode' | |
{ # distribution for unary prefix | |
my @r; | |
@r = -« ([1, 2], [3, [4, 5]]); | |
my @e = ([-1, -2], [-3, [-4, -5]]); | |
is(~@r, ~@e, "distribution for unary prefix"); | |
@r = -<< ([1, 2], [3, [4, 5]]); |
OlderNewer