<commit_before>{-# LANGUAGE RebindableSyntax  #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PackageImports    #-}

{-
  Copyright 2015 Google Inc. All rights reserved.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-}

module Internal.Picture where

import qualified "base" Prelude as P
import Internal.Num
import Internal.Text
import Internal.Color

type Point = (Number, Number)
type Vector = (Number, Number)

addVectors :: (Vector, Vector) -> Vector
addVectors ((x1,y1), (x2,y2)) = (x1 + x2, y1 + y2)

vectorSum :: (Vector, Vector) -> Vector
vectorSum = addVectors

subtractVectors :: (Vector, Vector) -> Vector
subtractVectors ((x1,y1), (x2,y2)) = (x1 - x2, y1 - y2)

vectorDifference :: (Vector, Vector) -> Vector
vectorDifference = subtractVectors

scaleVector :: (Vector, Number) -> Vector
scaleVector ((x,y), k) = (k*x, k*y)

scaledVector :: (Vector, Number) -> Vector
scaledVector = scaleVector

rotateVector :: (Vector, Number) -> Vector
rotateVector ((x,y), angle) = (x * cos angle - y * sin angle,
                               x * sin angle + y * cos angle)

rotatedVector :: (Vector, Number) -> Vector
rotatedVector = rotateVector

{-# WARNING addVectors "Please use vectorSum(...) instead of addVectors(...)" #-}
{-# WARNING subtractVectors "Please use vectorDifference(...) instead of subtractVectors(...)" #-}
{-# WARNING scaleVector "Please use scaledVector(...) instead of scaleVector(...)" #-}
{-# WARNING rotatedVector "Please use rotatedVector(...) instead of rotateVector(...)" #-}

data Picture = Polygon [Point]<commit_msg>Fix deprecation warning on the wrong entity.<commit_after>{-# LANGUAGE RebindableSyntax  #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PackageImports    #-}

{-
  Copyright 2015 Google Inc. All rights reserved.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-}

module Internal.Picture where

import qualified "base" Prelude as P
import Internal.Num
import Internal.Text
import Internal.Color

type Point = (Number, Number)
type Vector = (Number, Number)

addVectors :: (Vector, Vector) -> Vector
addVectors ((x1,y1), (x2,y2)) = (x1 + x2, y1 + y2)

vectorSum :: (Vector, Vector) -> Vector
vectorSum = addVectors

subtractVectors :: (Vector, Vector) -> Vector
subtractVectors ((x1,y1), (x2,y2)) = (x1 - x2, y1 - y2)

vectorDifference :: (Vector, Vector) -> Vector
vectorDifference = subtractVectors

scaleVector :: (Vector, Number) -> Vector
scaleVector ((x,y), k) = (k*x, k*y)

scaledVector :: (Vector, Number) -> Vector
scaledVector = scaleVector

rotateVector :: (Vector, Number) -> Vector
rotateVector ((x,y), angle) = (x * cos angle - y * sin angle,
                               x * sin angle + y * cos angle)

rotatedVector :: (Vector, Number) -> Vector
rotatedVector = rotateVector

{-# WARNING addVectors "Please use vectorSum(...) instead of addVectors(...)" #-}
{-# WARNING subtractVectors "Please use vectorDifference(...) instead of subtractVectors(...)" #-}
{-# WARNING scaleVector "Please use scaledVector(...) instead of scaleVector(...)" #-}
{-# WARNING rotateVector "Please use rotatedVector(...) instead of rotateVector(...)" #-}

data Picture = Polygon [Point]
{'fraction_non_alphanumeric': 0.12506047411707788, 'fraction_numerical': 0.011611030478955007, 'mean_word_length': 3.864705882352941, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6944956', 'n_tokens_mistral': 1280, 'n_tokens_neox': 1250, 'n_words': 455}