Popularity
5.0
Growing
Activity
0.0
Stable
4
2
4

Monthly Downloads: 10
Programming language: Haskell
License: MIT License
Tags: Language    

haskell-brainfuck alternatives and similar packages

Based on the "Language" category.
Alternatively, view haskell-brainfuck alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of haskell-brainfuck or a related project?

Add another 'Language' Package

README

haskell-brainfuck

Interpreter for the brainfuck programming language

Build Status

haskel-brainfuck is distributed as a library, but it also includes an executable to run brainfuck programs. You can find haskell-brainfuck in Hackage

Usage

Library

import HaskBF.Eval
import qualified Data.ByteString.Lazy as BS
import Control.Monad.State

main = do
  -- The following will evaluate the file using stdin and stdout for I/O.
  -- Evaluation results in an EvalResult

  file <- BS.readFile "/path/to/file.bf"
  (EvalSuccess _) <- evalBS defaultIOMachine file
  print "ok"


  -- The following will evaluate the file using the State monad and input
  -- provided by input

  let input  = []
      output = []
      result = execState (evalStr simulatorMachine "+.>-.") (SimState input output)
  print $ simStateOutput result == [1, -1]

Executable

brainfuck fib.bf

Tests

You can run the test suite with

cabal test

Documentation

http://paraseba.github.io/haskell-brainfuck/