Skip to content

Commit

Permalink
Rewrite List.map function from core library for more efficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
Viir committed Jul 21, 2024
1 parent 526e461 commit dc3cad6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
6 changes: 3 additions & 3 deletions implement/Pine.Core/Pine.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<AssemblyVersion>0.3.13</AssemblyVersion>
<FileVersion>0.3.13</FileVersion>
<AssemblyVersion>0.3.14</AssemblyVersion>
<FileVersion>0.3.14</FileVersion>
</PropertyGroup>

<PropertyGroup>
<PackageId>Pine.Core</PackageId>
<Version>0.3.13</Version>
<Version>0.3.14</Version>
<Description>The cross-platform Elm runtime environment</Description>
<PackageTags>Functional;Elm;Runtime;Compiler;VM;DBMS</PackageTags>
<RepositoryUrl>https://github.com/pine-vm/pine.git</RepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,17 @@ cons element list =
map : (a -> b) -> List a -> List b
map f xs =
foldr (\\x acc -> cons (f x) acc ) [] xs
mapHelp f xs []
mapHelp : (a -> b) -> List a -> List b -> List b
mapHelp f remaining acc =
case remaining of
[] ->
Pine_kernel.reverse acc
x :: xs ->
mapHelp f xs (Pine_kernel.concat [ [ f x ], acc ])
indexedMap : (Int -> a -> b) -> List a -> List b
Expand Down
2 changes: 1 addition & 1 deletion implement/pine/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace ElmTime;

public class Program
{
public static string AppVersionId => "0.3.13";
public static string AppVersionId => "0.3.14";

private static int AdminInterfaceDefaultPort => 4000;

Expand Down
4 changes: 2 additions & 2 deletions implement/pine/pine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>pine</AssemblyName>
<AssemblyVersion>0.3.13</AssemblyVersion>
<FileVersion>0.3.13</FileVersion>
<AssemblyVersion>0.3.14</AssemblyVersion>
<FileVersion>0.3.14</FileVersion>
<Nullable>enable</Nullable>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
</PropertyGroup>
Expand Down

0 comments on commit dc3cad6

Please sign in to comment.