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 Source | |
Rubyable Float Source | |
Rubyable Int Source | |
Rubyable () Source | |
Rubyable ByteString Source | |
Rubyable RubyObject Source | |
(Rubyable a, Rubyable b) => Rubyable [(a, b)] Source | |
Rubyable a => Rubyable [a] Source | |
Rubyable a => Rubyable (Maybe a) Source | |
(Rubyable a, Rubyable b) => Rubyable (Vector (a, b)) Source | |
Rubyable a => Rubyable (Vector a) Source | |
Rubyable (ByteString, RubyStringEncoding) Source | |
(Rubyable a, Rubyable b, Ord a) => Rubyable (Map a b) Source |