Created
June 24, 2026 00:59
-
-
Save samwinslow/029bd43c578bde2adc02fac59376fb74 to your computer and use it in GitHub Desktop.
FAA Airspace Visibility/Cloud Clearance Requirements (14 CFR 91.155)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Airspace designation. | |
| data Airspace = A | B | C | D | E | G | |
| deriving (Eq, Show) | |
| -- The resulting cloud clearance. | |
| data Clearance | |
| = CC -- Clear of clouds | |
| | IFR -- IFR only; no clearance required | |
| | C152 -- 1000 above, 500 below, 2000 horiz | |
| | F111 -- 1000 above, 1000 below, 1 SM horiz | |
| deriving (Eq, Show) | |
| data Reqs = Reqs | |
| { | |
| visibility :: Int, -- Statute miles | |
| clearance :: Clearance | |
| } deriving (Eq, Show) | |
| -- Other inputs: | |
| -- msl: Altitude in feet above mean sea level. | |
| -- agl: Altitude in feet above ground level. | |
| -- night: Whether it is nighttime. | |
| -- tp: Whether operating in a traffic pattern within 1/2 SM of the runway; see 14 CFR 91.155(b)(2) | |
| requirements :: Airspace -> Int -> Bool -> Bool -> Int -> Reqs | |
| requirements A _ _ _ _ = | |
| Reqs 0 IFR | |
| requirements B _ _ _ _ = | |
| Reqs 3 CC | |
| requirements C _ _ _ _ = | |
| Reqs 3 C152 | |
| requirements D _ _ _ _ = | |
| Reqs 3 C152 | |
| requirements E msl _ _ _ | |
| | msl >= 10000 = | |
| Reqs 5 F111 | |
| | otherwise = | |
| Reqs 3 C152 | |
| requirements G msl night tp agl | |
| | agl <= 1200 && night && not tp = | |
| Reqs 3 C152 | |
| | agl <= 1200 = | |
| Reqs 1 CC | |
| | msl >= 10000 = | |
| Reqs 5 F111 | |
| | night = | |
| Reqs 3 C152 | |
| | otherwise = | |
| Reqs 1 C152 | |
| -- Test cases. | |
| main :: IO () | |
| main = do | |
| print "Class A airspace." | |
| print $ requirements A 21000 False False 18000 | |
| print "Class B airspace." | |
| print $ requirements B 5000 False False 5000 | |
| print "Class C airspace." | |
| print $ requirements C 4000 False False 4000 | |
| print "Class E airspace above 10k MSL, 500 AGL (e.g. high-altitude airport with E to sfc.)" | |
| print $ requirements E 12000 False False 500 | |
| print "More typical Class E airspace." | |
| print $ requirements E 5000 False False 4500 | |
| print "Class G, below 1200 AGL, daytime." | |
| print $ requirements G 1800 False False 800 | |
| print "Class G, below 1200 AGL, nighttime, not in traffic pattern." | |
| print $ requirements G 1800 True False 800 | |
| print "Class G, below 1200 AGL, nighttime, in traffic pattern." | |
| print $ requirements G 1800 True True 800 | |
| print "Class G, above 1200 AGL, nighttime, high altitude (rare)." | |
| print $ requirements G 12000 True False 2000 | |
| print "Class G, above 1200 AGL, daytime (rare)." | |
| print $ requirements G 5000 False False 2000 | |
| print "Class G, above 1200 AGL, nighttime (rare)." | |
| print $ requirements G 5000 True False 2000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment