~singpolyma/dhall-ruby

ref: ca1cda0acce5391041a593d50a1fd4928864fac4 dhall-ruby/lib/dhall/types.rb -rw-r--r-- 349 bytes
ca1cda0aStephen Paul Weber Require SimpleDelegator properly 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

require "dhall/builtins"

module Dhall
	module Types
		def self.MAP_ENTRY(k: Builtins[:Text], v: Builtins[:Text])
			RecordType.new(
				record: {
					"mapKey" => k, "mapValue" => v
				}
			)
		end

		def self.MAP(k: Builtins[:Text], v: Builtins[:Text])
			Builtins[:List].call(MAP_ENTRY(k: k, v: v))
		end
	end
end