Skip to content

Commit

Permalink
Hash some more candidates for name
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjoosten committed May 13, 2023
1 parent 069c35b commit 7947e31
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/Ampersand/Basics/PandocExtended.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Ampersand.Basics.Prelude hiding (toList)
import Ampersand.Basics.String (toText1Unsafe)
import Ampersand.Basics.Unique
import Ampersand.Basics.Version
import Data.Hashable (hash)
import qualified RIO.Text as T
import Text.Pandoc hiding (Meta)
import Text.Pandoc.Builder hiding (str)
Expand All @@ -26,7 +27,7 @@ data Markup = Markup
deriving (Show, Eq, Ord, Typeable, Data)

instance Unique Markup where
showUnique = toText1Unsafe . tshow
showUnique x = toText1Unsafe ("Markup_" <> (tshow . abs . hash . tshow) x)

-- | a way to show the pandoc in a default way. We currently use Markdown for this purpose.
aMarkup2String :: Markup -> Text
Expand Down
10 changes: 5 additions & 5 deletions src/Ampersand/Core/AbstractSyntaxTree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ showWithSign rel = tName rel <> showSign rel
newtype Meaning = Meaning {ameaMrk :: Markup} deriving (Show, Eq, Ord, Typeable, Data)

instance Unique Meaning where
showUnique = toText1Unsafe . tshow
showUnique x = toText1Unsafe ("Meaning_" <> (tshow . abs . hash . tshow) x)

instance Named Relation where
name = decnm
Expand Down Expand Up @@ -709,7 +709,7 @@ data BoxItem
deriving (Eq, Show)

instance Unique BoxItem where
showUnique = toText1Unsafe . tshow
showUnique x = toText1Unsafe ("BoxItem" <> (tshow . abs . hash . tshow) x)

instance Traced BoxItem where
origin o =
Expand Down Expand Up @@ -762,7 +762,7 @@ instance Traced ObjectDef where
origin = objPos

instance Unique ObjectDef where
showUnique = toText1Unsafe . tshow
showUnique x = toText1Unsafe ("ObjectDef_" <> (tshow . abs . hash . tshow) x)

instance Ord ObjectDef where
compare a b = case compare (objPlainName a) (objPlainName b) of
Expand Down Expand Up @@ -1067,10 +1067,10 @@ instance Unique Expression where
-- expressions with the same showA.

instance Unique (PairView Expression) where
showUnique = toText1Unsafe . tshow
showUnique x = toText1Unsafe ("PairView_" <> (tshow . abs . hash . tshow) x)

instance Unique (PairViewSegment Expression) where
showUnique = toText1Unsafe . tshow
showUnique x = toText1Unsafe ("PairViewSegment_Expression_" <> (tshow . abs . hash . tshow) x)

(.==.), (.|-.), (./\.), (.\/.), (.-.), (./.), (.\.), (.<>.), (.:.), (.!.), (.*.) :: Expression -> Expression -> Expression

Expand Down
2 changes: 1 addition & 1 deletion src/Ampersand/Core/ParseTree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ instance Traced PAtomValue where
ScriptDateTime o _ -> o

instance Unique PAtomValue where
showUnique = toText1Unsafe . tshow
showUnique x = toText1Unsafe ("AtomValue_" <> (tshow . abs . hash . tshow) x)

mkPair :: Origin -> PAtomValue -> PAtomValue -> PAtomPair
mkPair o l r =
Expand Down
1 change: 1 addition & 0 deletions src/Ampersand/Prototype/aap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker run --detach --name Ampersand_mariadb --env MARIADB_USER=ampersand --env MARIADB_PASSWORD=ampersand --env MARIADB_ROOT_PASSWORD=ampersand mariadb:latest

0 comments on commit 7947e31

Please sign in to comment.