ByteStrings in Haskell
Posted
by Jon
on Stack Overflow
See other posts from Stack Overflow
or by Jon
Published on 2010-04-16T00:55:48Z
Indexed on
2010/04/16
1:03 UTC
Read the original article
Hit count: 430
So i am trying to write a program that can read in a java class file as bytecode. For this i am using Data.Binary and Data.ByteStream. The problem i am having is because im pretty new to Haskell i am having trouble actually using these tools.
module Main where
import Data.Binary.Get
import Data.Word
import qualified Data.ByteString.Lazy as S
getBinary :: Get Word8
getBinary = do
a <- getWord8
return (a)
main :: IO ()
main = do
contents <- S.getContents
print (getBinary contents)
This is what i have come up with so far and i fear that its not really even on the right track. Although i know this question is very general i would appreciate some help with what i should be doing with the reading.
© Stack Overflow or respective owner