<commit_before>{-# LANGUAGE GeneralizedNewtypeDeriving #-}

module SMACCMPilot.Flight.Types.FlightModeData
  ( FlightMode()
  , flightModeStabilize
  , flightModeAltHold
  , flightModeAuto
  , fromFlightMode
  , flightModes
  ) where

import Ivory.Language

newtype FlightMode = FlightMode Uint8
  deriving (Num, IvoryType, IvoryVar, IvoryExpr, IvoryEq, IvoryStore, IvoryInit)

flightModeStabilize, flightModeAltHold, flightModeAuto :: FlightMode
flightModeStabilize = FlightMode 0
flightModeAltHold   = FlightMode 1
flightModeAuto      = FlightMode 2

fromFlightMode :: FlightMode -> Uint8
fromFlightMode (FlightMode fm) = fm

flightModes :: [FlightMode]
flightModes = [ flightModeStabilize, flightModeAltHold, flightModeAuto ]
<commit_msg>flight mode auto is 3, not 2, so its easier to treat as a bitfield<commit_after>{-# LANGUAGE GeneralizedNewtypeDeriving #-}

module SMACCMPilot.Flight.Types.FlightModeData
  ( FlightMode()
  , flightModeStabilize
  , flightModeAltHold
  , flightModeAuto
  , fromFlightMode
  , flightModes
  ) where

import Ivory.Language

newtype FlightMode = FlightMode Uint8
  deriving (Num, IvoryType, IvoryVar, IvoryExpr, IvoryEq, IvoryStore, IvoryInit)

flightModeStabilize, flightModeAltHold, flightModeAuto :: FlightMode
flightModeStabilize = FlightMode 0
flightModeAltHold   = FlightMode 1
flightModeAuto      = FlightMode 3

fromFlightMode :: FlightMode -> Uint8
fromFlightMode (FlightMode fm) = fm

flightModes :: [FlightMode]
flightModes = [ flightModeStabilize, flightModeAltHold, flightModeAuto ]

{'fraction_non_alphanumeric': 0.07166123778501629, 'fraction_numerical': 0.007817589576547232, 'mean_word_length': 5.64935064935065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5624266', 'n_tokens_mistral': 537, 'n_tokens_neox': 499, 'n_words': 118}