This file contains hidden or 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
{-# OPTIONS_GHC -fplugin Data.UnitsOfMeasure.Plugin #-} | |
{-# LANGUAGE DataKinds, QuasiQuotes, TypeOperators #-} | |
{-# LANGUAGE TypeFamilies, UndecidableInstances #-} | |
import Data.UnitsOfMeasure | |
main :: IO () | |
main = print ([u| 3 m |] :: Quantity Int [u| m |]) | |
This file contains hidden or 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
<<<<<<<<<<<< HEAD | |
ローカルの変更内容 | |
============ | |
リモートの変更内容 | |
>>>>>>>>>>>> リモートブランチの名前 |
This file contains hidden or 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
OPEN SHELLを選択 | |
git statusを入力、エンター | |
both modified: ファイル名 | |
と、コンフリクトを起こしているファイル名が表示されるので、 | |
エディタ(メモ帳は改行が反映されてないので出来ればそれ以外、Sublime、Terapadなど)で開く | |
<<<<<<<<<<<<と |
This file contains hidden or 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
{- | | |
Choose a set of words so that each alphabet is contained exactly once. | |
<http://en.wikipedia.org/wiki/Pangram> | |
This example illustrates the mose | |
-} | |
module Main where |
This file contains hidden or 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
src/Model/Disk.hs:132:16: | |
Couldn't match type ‘Mass’ with ‘Length’ | |
Expected type: Getting Length s Length | |
Actual type: (Mass -> Const Length Mass) -> s -> Const Length s | |
In the first argument of ‘env’, namely ‘centralStarMass’ | |
In the expression: env centralStarMass :: Mass | |
src/Model/Disk.hs:137:19: | |
Couldn't match type ‘Time’ with ‘Length’ | |
Expected type: (Velocity -> f Velocity) |
This file contains hidden or 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.Parallel.Strategies | |
fib :: Integer -> Integer | |
fib 0 = 0 | |
fib 1 = 1 | |
fib n = fib (n-1) + fib (n-2) | |
main = do | |
let (rx, ry) = runEval $ do | |
x <- rpar $ fib 38 `seq` (undefined :: Integer) |
This file contains hidden or 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.Parallel.Strategies | |
fib :: Integer -> Integer | |
fib 0 = 0 | |
fib 1 = 1 | |
fib n = fib (n-1) + fib (n-2) | |
main = print . snd . runEval $ do | |
x <- rpar $ (undefined :: Integer) -- (fib 100) | |
y <- rpar (fib 100) |
This file contains hidden or 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.Typeable | |
import Test.Hspec | |
arityOf :: Typeable a => a -> Int | |
arityOf x = go $ typeOf x | |
where | |
go tr | |
| isFun $ typeRepTyCon tr = 1 + go (last $ snd $ splitTyConApp tr) | |
| otherwise = 0 |
This file contains hidden or 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
gnuplot :: [String] -> IO () | |
gnuplot cmds = do | |
writeFile "tmp" $ unlines cmds | |
system "gnuplot tmp" | |
return () | |
main = do | |
gnuplot [ gnuplotSetTerm |
This file contains hidden or 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
main :: IO () | |
main = top 10 | |
top :: Int -> IO () | |
top mp = do | |
putStrLn $ "あなたのMPは:" ++ show mp | |
putStrLn "どこへ行く?" | |
choice [ ("宿屋" , inn) | |
, ("野外" , outdoor mp) ] |