<commit_before><commit_msg>Just realized all of the commits previously missed "Quantity.hs" in Language/Drasil/Chunk/. Adding it now.<commit_after>{-# OPTIONS -Wall #-}
{-# LANGUAGE GADTs #-}
module Language.Drasil.Chunk.Quantity where

import Control.Lens

import Language.Drasil.Space
import Language.Drasil.Chunk
import Language.Drasil.Unit
import Prelude hiding (id)

class NamedIdea c => Quantity c where
  typ      :: Simple Lens c Space
  getSymb  :: c -> Maybe SF
  getUnit  :: c -> Maybe UnitDefn

instance Quantity VarChunk where
  getSymb vc = Just $ SF vc 
  getUnit _  = Nothing
  typ f (VC n d s t) = fmap (\x -> VC n d s x) (f t)
  
instance Quantity ConVar where
  typ    f (CV c s t) = fmap (\x -> CV c s x) (f t)
  getSymb   = Just . SF 
  getUnit _ = Nothing
{'fraction_non_alphanumeric': 0.0990990990990991, 'fraction_numerical': 0.0, 'mean_word_length': 3.073298429319372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '6598116', 'n_tokens_mistral': 282, 'n_tokens_neox': 271, 'n_words': 102}