From 5b222d040ee361dd4022e88488a6bcef3ca40a71 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 12 Oct 2020 01:04:47 -0400 Subject: Tweaked how I64 masks are made. --- stdlib/source/program/aedifex/project.lux | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'stdlib/source/program') diff --git a/stdlib/source/program/aedifex/project.lux b/stdlib/source/program/aedifex/project.lux index 15abd9ee1..071f54b12 100644 --- a/stdlib/source/program/aedifex/project.lux +++ b/stdlib/source/program/aedifex/project.lux @@ -1,8 +1,9 @@ (.module: [lux (#- Name) [abstract - ["." monad (#+ do)] - ["." equivalence (#+ Equivalence)]] + [equivalence (#+ Equivalence)] + [monoid (#+ Monoid)] + ["." monad (#+ do)]] [control ["." try (#+ Try)] ["." exception (#+ exception:)]] @@ -19,13 +20,23 @@ (type: #export Project (Dictionary Name Profile)) -(def: #export empty - (dictionary.from-list text.hash (list [//.default (:: //.monoid identity)]))) +(def: #export (project name profile) + (-> Name Profile Project) + (dictionary.from-list text.hash (list [name profile]))) (def: #export equivalence (Equivalence Project) (dictionary.equivalence //.equivalence)) +(structure: #export monoid + (Monoid Project) + + (def: identity + (dictionary.new text.hash)) + + (def: compose + (dictionary.merge-with (:: //.monoid compose)))) + (exception: #export (unknown-profile {name Name}) (exception.report ["Name" (%.text name)])) @@ -50,12 +61,12 @@ (get@ #//.parents profile))] (wrap (list@fold (function (_ parent child) (:: //.monoid compose child parent)) - profile + (set@ #//.parents (list) profile) parents)))) #.None (exception.throw ..unknown-profile [name]))) -(def: #export (profile project name) - (-> Project Name (Try Profile)) - (profile' (set.new text.hash) project name)) +(def: #export (profile name project) + (-> Name Project (Try Profile)) + (..profile' (set.new text.hash) project name)) -- cgit v1.2.3