Created
          June 26, 2015 05:39 
        
      - 
      
- 
        Save jagregory/34bbacb51234b2bd3537 to your computer and use it in GitHub Desktop. 
    newtype
  
        
  
    
      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
    
  
  
    
  | newtype Degree = Degree Float | |
| newtype Radian = Radian Float | |
| toRad :: Degree -> Radian | |
| toRad (Degree deg) = Radian (deg * pi / 180) | |
| -- this works | |
| new1 = toRad (Degree 90.0) | |
| -- this doesn't work | |
| -- new2 = toRad (Radian 1.25) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment