<commit_before>IO in Elm [![Build Status](https://travis-ci.org/maxsnew/IO.png?branch=master)](https://travis-ci.org/maxsnew/IO)
=========

This repo provides a library for writing console-based programs in
Elm.

Example
-------
An elm Program:
```haskell
module Main where

import IO.IO (..)
import IO.Runner exposing (Request, Response)
import IO.Runner as IO

import List
import Maybe
import String

echo : IO ()
echo = forever (getLine >>= putStrLn)

loop : IO ()
loop = getLine >>= \s ->
       if s == "exit"
       then pure ()
       else putStrLn s >>> loop
       
hello : IO ()
hello = putStrLn "Hello, Console!" >>>
        putStrLn "I'll echo your input until you say \"exit\":" >>>
        loop >>>
        putStrLn "That's all, folks!" >>>
        exit 0

port requests : Signal Request
port requests = IO.run responses hello

port responses : Signal Response
```

link in some javascript and then run:
```
$ elm-make --yes Test.elm raw-test.js
...
$ ./elm-io.sh raw-test.js test.js
$ node test.js
Hello, Console!
I'll echo your input:
hooray
hooray
That's all, folks!
```

Command Line Interface
----------------------

The basic interface is `elm-io.sh infile outfile`, where `infile` is a
compiled Elm file with requests and response signals set up as above
and `outfile` is the desired filename for the compiled output.

Design and Implementation
-------------------------
The implementation is based on the
[IOSpec](http://hackage.haskell.org/package/IOSpec) haskell library.
<commit_msg>Switch to Elm syntax highlighting in README<commit_after>IO in Elm [![Build Status](https://travis-ci.org/maxsnew/IO.png?branch=master)](https://travis-ci.org/maxsnew/IO)
=========

This repo provides a library for writing console-based programs in
Elm.

Example
-------
An elm Program:
```elm
module Main where

import IO.IO (..)
import IO.Runner exposing (Request, Response)
import IO.Runner as IO

import List
import Maybe
import String

echo : IO ()
echo = forever (getLine >>= putStrLn)

loop : IO ()
loop = getLine >>= \s ->
       if s == "exit"
       then pure ()
       else putStrLn s >>> loop
       
hello : IO ()
hello = putStrLn "Hello, Console!" >>>
        putStrLn "I'll echo your input until you say \"exit\":" >>>
        loop >>>
        putStrLn "That's all, folks!" >>>
        exit 0

port requests : Signal Request
port requests = IO.run responses hello

port responses : Signal Response
```

link in some javascript and then run:
```
$ elm-make --yes Test.elm raw-test.js
...
$ ./elm-io.sh raw-test.js test.js
$ node test.js
Hello, Console!
I'll echo your input:
hooray
hooray
That's all, folks!
```

Command Line Interface
----------------------

The basic interface is `elm-io.sh infile outfile`, where `infile` is a
compiled Elm file with requests and response signals set up as above
and `outfile` is the desired filename for the compiled output.

Design and Implementation
-------------------------
The implementation is based on the
[IOSpec](http://hackage.haskell.org/package/IOSpec) haskell library.

{'fraction_non_alphanumeric': 0.1525312294543064, 'fraction_numerical': 0.0006574621959237344, 'mean_word_length': 2.9264516129032256, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 43, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1474495', 'n_tokens_mistral': 970, 'n_tokens_neox': 927, 'n_words': 348}