Copyright | (c) Philip Cunningham, 2015 |
---|---|
License | MIT |
Maintainer | hello@filib.io |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Core RubyObject data representation.
- data RubyObject
- = RNil
- | RBool !Bool
- | RFixnum !Int
- | RArray !(Vector RubyObject)
- | RHash !(Vector (RubyObject, RubyObject))
- | RIVar !(RubyObject, RubyStringEncoding)
- | RString !ByteString
- | RFloat !Float
- | RSymbol !ByteString
- | Unsupported
- class Rubyable a where
- toRuby :: a -> RubyObject
- fromRuby :: RubyObject -> Maybe a
Documentation
data RubyObject Source
Representation of a Ruby object.
RNil | represents |
RBool !Bool | represents |
RFixnum !Int | represents a |
RArray !(Vector RubyObject) | represents an |
RHash !(Vector (RubyObject, RubyObject)) | represents an |
RIVar !(RubyObject, RubyStringEncoding) | represents an |
RString !ByteString | represents a |
RFloat !Float | represents a |
RSymbol !ByteString | represents a |
Unsupported | represents an invalid object |
Transform plain Haskell values to RubyObjects and back.
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.
Rubyable Bool | |
Rubyable Float | |
Rubyable Int | |
Rubyable () | |
Rubyable ByteString | |
Rubyable RubyObject | |
(Rubyable a, Rubyable b) => Rubyable [(a, b)] | |
Rubyable a => Rubyable [a] | |
Rubyable a => Rubyable (Maybe a) | |
(Rubyable a, Rubyable b) => Rubyable (Vector (a, b)) | |
Rubyable a => Rubyable (Vector a) | |
Rubyable (ByteString, RubyStringEncoding) | |
(Rubyable a, Rubyable b, Ord a) => Rubyable (Map a b) |