Skip to content

nogginly/sugar.cr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sugar for Crystal

Some syntactic (and maybe API) sugar for Crystal programs.

Installation

  1. Add the dependency to your project's shard.yml:

    dependencies:
      sugar:
        github: nogginly/sugar.cr
  2. Run shards install

Usage

Lazy variables

require 'sugar'

include Sugar

class Num(T)
  def initialize(@value : T); end

  lazy square : T { @value.abs2 }

  lazy twice : T do
    @value * 2
  end
end

Contributing

Bug 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.

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

Contributors

About

Some syntactic (and maybe API) sugar for Crystal programs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors