1///////////////////////////////////////////////////////////////////////////////
3// Module : purescript.cpp
4// Copyright : (c) Andy Arvanitis 2019
7// Maintainer : Andy Arvanitis
8// Stability : experimental
11// Basic types and functions to support purescript-to-C++ rendering
13///////////////////////////////////////////////////////////////////////////////
15#include "purescript.h"
19template class _template_::fn_t<boxed>;
20template class _template_::eff_fn_t<boxed>;
21template class _template_::dict_t<boxed>;
22template class _template_::weak<boxed>;
23template class _template_::recur<boxed>;
25boxed::boxed(const long n) : _int_(static_cast<int>(n)) {
26#if !defined(NDEBUG) && !defined(PURESCRIPT_DISABLE_EXCEPTIONS)
27 if (n < std::numeric_limits<int>::min() || n > std::numeric_limits<int>::max()) {
28 throw std::runtime_error("integer out of range");
33boxed::boxed(const unsigned long n) : _int_(static_cast<int>(n)) {
34#if !defined(NDEBUG) && !defined(PURESCRIPT_DISABLE_EXCEPTIONS)
35 if (n > std::numeric_limits<int>::max()) {
36 throw std::runtime_error("integer out of range");
41auto boxed::operator[](const int index) const -> const boxed& {
43 return static_cast<const array_t*>(shared.get())->at(index);
45 return (*static_cast<const array_t*>(shared.get()))[index];
49auto boxed::operator[](const int index) -> boxed& {
51 return static_cast<array_t*>(shared.get())->at(index);
53 return (*static_cast<array_t*>(shared.get()))[index];
59} // namespace purescript
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list