<commit_before>module Language.StreamIt.Core
  ( E (..)
  , V (..)
  , A (..)
  , Name
  , PathName (..)
  , AllE (..)
  , NumE
  , Const (..)
  , Statement (..)
  , arrayLength
  ) where

import Data.Ratio

type Name = String

-- | A mutable variable.
data V a
  = V Name a
  deriving Eq

-- | A mutable array.
data A a = A Name [a] deriving (Eq, Ord)

-- | Length of array.
arrayLength :: A a -> Int
arrayLength (A _ a) = length a

class    PathName a       where pathName :: a -> String

instance PathName Name    where pathName = id
instance PathName (V a)   where
  pathName a = case a of
    V name _ -> pathName name
    -- VArray a _ -> pathName a
instance PathName (A a)   where pathName (A a _) = pathName a

class Eq a => AllE a where
  zero   :: a
  const' :: a -> Const

instance AllE Bool where
  zero = False
  const' = Bool

instance AllE Int where<commit_msg>need to add arrays eventually, take out the unused cruft<commit_after>module Language.StreamIt.Core
  ( E (..)
  , V (..)
  , Name
  , PathName (..)
  , AllE (..)
  , NumE
  , Const (..)
  , Statement (..)
  ) where

import Data.Ratio

type Name = String

-- | A mutable variable.
data V a
  = V Name a
  deriving Eq

class    PathName a       where pathName :: a -> String

instance PathName Name    where pathName = id
instance PathName (V a)   where
  pathName a = case a of
    V name _ -> pathName name
    -- VArray a _ -> pathName a

class Eq a => AllE a where
  zero   :: a
  const' :: a -> Const

instance AllE Bool where
  zero = False
  const' = Bool

instance AllE Int where
{'fraction_non_alphanumeric': 0.11203585147247119, 'fraction_numerical': 0.0, 'mean_word_length': 2.2494802494802495, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2817657', 'n_tokens_mistral': 548, 'n_tokens_neox': 542, 'n_words': 206}