ruby-marshal-0.1.1: Parse a subset of Ruby objects serialised with Marshal.dump.

Copyright(c) Philip Cunningham, 2015
LicenseMIT
Maintainerhello@filib.io
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.Ruby.Marshal.RubyObject

Description

Core RubyObject data representation.

Synopsis

Documentation

data RubyObject Source

Representation of a Ruby object.

Constructors

RNil

represents nil

RBool !Bool

represents true or false

RFixnum !Int

represents a Fixnum

RArray !(Vector RubyObject)

represents an Array

RHash !(Vector (RubyObject, RubyObject))

represents an Hash

RIVar !(RubyObject, RubyStringEncoding)

represents an IVar

RString !ByteString

represents a String

RFloat !Float

represents a Float

RSymbol !ByteString

represents a Symbol

Unsupported

represents an invalid object

class Rubyable a where Source

Transform plain Haskell values to RubyObjects and back.

Methods

toRuby :: a -> RubyObject Source

Takes a plain Haskell value and lifts into RubyObject

fromRuby :: RubyObject -> Maybe a Source

Takes a RubyObject transforms it into a more general Haskell value.