# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # --type-backward Readme1.MyMaybe === module Readme1 where maybe :: b -> (a -> b) -> Maybe a -> b maybe d f mb = case mb of Nothing -> d Just x -> f x type MyMaybe = Maybe Int {-# RULES "myRule" forall x. maybe Nothing Just x = x #-} -foo :: Maybe Int +foo :: MyMaybe foo = maybe Nothing Just (Just 5)