Some syntactic (and maybe API) sugar for Crystal programs.
-
Add the dependency to your project's
shard.yml:dependencies: sugar: github: nogginly/sugar.cr
-
Run
shards install
require 'sugar'
include Sugar
class Num(T)
def initialize(@value : T); end
lazy square : T { @value.abs2 }
lazy twice : T do
@value * 2
end
endBug reports and sugestions are welcome, please raise an issue if you find a problem or have a question. Otherwise, for now, this project is closed for pull requests. I appreciate your understanding.
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
- nogginly - creator and maintainer