<commit_before><commit_msg>implemented trivial freezer factory for ICopyable<commit_after>﻿namespace LostTech.App
{
    using System;
    using System.Linq;
    using System.Reflection;

    public sealed class ClonableFreezerFactory : IFreezerFactory
    {
        private ClonableFreezerFactory() { }

        public static IFreezerFactory Instance { get; } = new ClonableFreezerFactory();

        public Func<T, TFreezed> MakeFreezer<T, TFreezed>()
        {
            if (!typeof(T).GetTypeInfo().ImplementedInterfaces.Any(@interface => @interface == typeof(ICopyable<TFreezed>)))
                throw new NotSupportedException($"This factory requires {nameof(T)} to implement {nameof(ICopyable<TFreezed>)}");

            return value => ((ICopyable<TFreezed>)value).Copy();
        }
    }
}
{'fraction_non_alphanumeric': 0.1111111111111111, 'fraction_numerical': 0.0, 'mean_word_length': 3.50561797752809, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5190922', 'n_tokens_mistral': 230, 'n_tokens_neox': 225, 'n_words': 48}