タグ

関連タグで絞り込む (2)

タグの絞り込みを解除

ghciに関するtheatricalのブックマーク (2)

  • GitHub - chrisdone/intero

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

    GitHub - chrisdone/intero
    theatrical
    theatrical 2014/11/05
    ghciをパワーアップさせた的な感じ
  • プロンプトで対話的に評価する

    例えば、putStrLn :: String -> IO ()に注意すると、次のようになる。 Prelude> putStrLn "hello" hello Prelude> do { putStrLn "hello"; return "yes" } hello "yes" GHCiは実際には単なる式ではなく文を受け付ける。そのため、値や関数を名前に束縛して、後で式や文の中で使うことができる。 GHCiプロンプトが受け付ける文の構文は、Haskellのdo式における文の構文と全く同じである。ただし、こちらにはモナドの多重定義はない。プロンプトに入力される文はIOモナドの中になければならない。 Prelude> x <- return 42 Prelude> print x 42 Prelude> x <- return 42という文は、「return 42をIOモナドの中で実行し、結果をx

    theatrical
    theatrical 2014/01/06
    "この問題を軽減するために、GHCiのコマンドを:{と:}で囲む(それぞれ一行使って)と、複数行に渡らせることができるようになっている。" 知らなかった
  • 1