haskell 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/Rakefile +1 -12
- data/bin/rubype +1 -1
- data/ext/{rubype → haskell}/extconf.rb +0 -0
- data/ext/{rubype/rubype.c → haskell/haskell.c} +0 -0
- data/ext/{rubype/rubype.h → haskell/haskell.h} +0 -0
- data/lib/haskell/version.rb +3 -0
- data/lib/{rubype.rb → haskell.rb} +7 -9
- data/rubype.gemspec +3 -3
- data/test/minitest_helper.rb +1 -1
- data/test/test_rubype.rb +1 -1
- metadata +7 -7
- data/lib/rubype/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9efb31f91a7475d1fcd51a18b529879ca3ab0ea
|
4
|
+
data.tar.gz: 3e9184b5470a354934ae4ceee378abb85444019c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fe9296da19d105b068cdabb4d56885022c88503db22a540230e27f43392d77181dece9c3f959a2cb921aa416fe858471dba5815bec6eab15a1c8f3f487b83d4
|
7
|
+
data.tar.gz: 4bfdcbda96973d27a17472ade7d7c19451976c75e2649de5c460ddcee16d6f2846def54127c7a703c4602018c6fe470eb8d97836932456540d67c98560d557d2
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ Matz has mentioned Ruby3.0 with static type at some confluences. But almost all
|
|
5
5
|
But it's worth thinking more. This gem is kind of trial without so much side-effect.
|
6
6
|
|
7
7
|
```rb
|
8
|
-
require '
|
8
|
+
require 'haskell'
|
9
9
|
|
10
10
|
# ex1
|
11
11
|
class MyClass
|
@@ -81,13 +81,13 @@ MyClass.new.foo('str')
|
|
81
81
|
|
82
82
|
## Installation
|
83
83
|
|
84
|
-
gem install
|
84
|
+
gem install haskell or add gem 'haskell' to your Gemfile.
|
85
85
|
|
86
86
|
This gem requires Ruby 2.0.0+.
|
87
87
|
|
88
88
|
### Contributing
|
89
89
|
|
90
|
-
Fork it ( https://github.com/[my-github-username]/
|
90
|
+
Fork it ( https://github.com/[my-github-username]/haskell/fork )
|
91
91
|
|
92
92
|
Create your feature branch (`git checkout -b my-new-feature`)
|
93
93
|
|
data/Rakefile
CHANGED
@@ -5,15 +5,4 @@ Rake::TestTask.new(:test) do |t|
|
|
5
5
|
t.libs << "test"
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
Rake::ExtensionTask.new("rubype") do |ext|
|
11
|
-
ext.lib_dir = "lib/rubype"
|
12
|
-
end
|
13
|
-
|
14
|
-
task :compile_and_test do
|
15
|
-
Rake::Task['compile'].invoke
|
16
|
-
Rake::Task['test'].invoke
|
17
|
-
end
|
18
|
-
|
19
|
-
task default: :compile_and_test
|
8
|
+
task default: :test
|
data/bin/rubype
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require "rubype/rubype"
|
2
|
-
|
3
1
|
# Builtin Contracts
|
4
2
|
class Any; end
|
5
3
|
module Boolean; end
|
@@ -8,26 +6,26 @@ FalseClass.send(:include, Boolean)
|
|
8
6
|
|
9
7
|
class Module
|
10
8
|
private
|
11
|
-
def
|
12
|
-
prepend (@
|
13
|
-
@
|
9
|
+
def __haskell__
|
10
|
+
prepend (@__haskell__ = Module.new) unless @__haskell__
|
11
|
+
@__haskell__
|
14
12
|
end
|
15
13
|
|
16
14
|
def typesig(hash)
|
17
15
|
meth = hash.keys.first
|
18
16
|
*arg_types, type_pair = hash.values.first
|
19
17
|
|
20
|
-
|
21
|
-
::
|
18
|
+
__haskell__.send(:define_method, meth) do |*args, &block|
|
19
|
+
::Haskell.assert_arg_type(meth, args, arg_types << type_pair.keys.first)
|
22
20
|
rtn = super(*args, &block)
|
23
|
-
::
|
21
|
+
::Haskell.assert_trn_type(meth, rtn, type_pair.values.first)
|
24
22
|
rtn
|
25
23
|
end
|
26
24
|
self
|
27
25
|
end
|
28
26
|
end
|
29
27
|
|
30
|
-
module
|
28
|
+
module Haskell
|
31
29
|
class << self
|
32
30
|
def assert_arg_type(meth, args, klasses)
|
33
31
|
args.each_with_index do |arg, i|
|
data/rubype.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require '
|
4
|
+
require 'haskell/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "haskell"
|
8
|
-
spec.version =
|
8
|
+
spec.version = Haskell::VERSION
|
9
9
|
spec.authors = ["gogotanaka"]
|
10
10
|
spec.email = ["mail@tanakakazuki.com"]
|
11
|
-
spec.extensions = ["ext/
|
11
|
+
spec.extensions = ["ext/haskell/extconf.rb"]
|
12
12
|
spec.summary = %q{Ruby with type.}
|
13
13
|
spec.description = %q{Ruby with type.}
|
14
14
|
spec.homepage = "http://gogotanaka.me/"
|
data/test/minitest_helper.rb
CHANGED
data/test/test_rubype.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haskell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gogotanaka
|
@@ -72,7 +72,7 @@ email:
|
|
72
72
|
executables:
|
73
73
|
- rubype
|
74
74
|
extensions:
|
75
|
-
- ext/
|
75
|
+
- ext/haskell/extconf.rb
|
76
76
|
extra_rdoc_files: []
|
77
77
|
files:
|
78
78
|
- ".gitignore"
|
@@ -82,11 +82,11 @@ files:
|
|
82
82
|
- README.md
|
83
83
|
- Rakefile
|
84
84
|
- bin/rubype
|
85
|
-
- ext/
|
86
|
-
- ext/
|
87
|
-
- ext/
|
88
|
-
- lib/
|
89
|
-
- lib/
|
85
|
+
- ext/haskell/extconf.rb
|
86
|
+
- ext/haskell/haskell.c
|
87
|
+
- ext/haskell/haskell.h
|
88
|
+
- lib/haskell.rb
|
89
|
+
- lib/haskell/version.rb
|
90
90
|
- rubype.gemspec
|
91
91
|
- test/minitest_helper.rb
|
92
92
|
- test/test_rubype.rb
|
data/lib/rubype/version.rb
DELETED