From 8ba6ac8952e3457b1a09e30ac5312168d48006d1 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 16 May 2018 00:11:49 -0400 Subject: - Migrated structure analysis to stdlib. - Added an easy way to report information in exceptions. --- new-luxc/source/luxc/lang.lux | 47 ------------------------------------------- 1 file changed, 47 deletions(-) (limited to 'new-luxc/source/luxc/lang.lux') diff --git a/new-luxc/source/luxc/lang.lux b/new-luxc/source/luxc/lang.lux index 1060eeb8e..28dd302c2 100644 --- a/new-luxc/source/luxc/lang.lux +++ b/new-luxc/source/luxc/lang.lux @@ -13,53 +13,6 @@ (lang (type ["tc" check]))) (luxc (lang ["la" analysis]))) -(type: #export Eval - (-> Type Code (Meta Top))) - -(def: #export (pl-get key table) - (All [a] (-> Text (List [Text a]) (Maybe a))) - (case table - #.Nil - #.None - - (#.Cons [k' v'] table') - (if (text/= key k') - (#.Some v') - (pl-get key table')))) - -(def: #export (pl-contains? key table) - (All [a] (-> Text (List [Text a]) Bool)) - (case (pl-get key table) - (#.Some _) - true - - #.None - false)) - -(def: #export (pl-put key val table) - (All [a] (-> Text a (List [Text a]) (List [Text a]))) - (case table - #.Nil - (list [key val]) - - (#.Cons [k' v'] table') - (if (text/= key k') - (#.Cons [key val] - table') - (#.Cons [k' v'] - (pl-put key val table'))))) - -(def: #export (pl-update key f table) - (All [a] (-> Text (-> a a) (List [Text a]) (List [Text a]))) - (case table - #.Nil - #.Nil - - (#.Cons [k' v'] table') - (if (text/= key k') - (#.Cons [k' (f v')] table') - (#.Cons [k' v'] (pl-update key f table'))))) - (def: (normalize-char char) (-> Nat Text) (case char -- cgit v1.2.3